:root {
    --bg: #f4f7f8;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #667582;
    --border: #d8e1e6;
    --accent: #236f7a;
    --accent-dark: #195762;
    --accent-soft: #edf5f6;
    --danger: #a43e3e;
    --success: #2f7452;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent-dark);
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

/* Header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
}

.user-name {
    font-weight: 600;
}

/* Main */

.main-content {
    padding: 40px 0 56px;
    min-height: calc(100vh - 160px);
}

/* Auth pages */

.auth-page .main-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 64px;
    padding-bottom: 72px;
}

.auth-shell {
    width: 100%;
    max-width: 430px;
}

.auth-card {
    width: 100%;
}

.auth-heading {
    margin-bottom: 26px;
}

.auth-heading h1 {
    margin-bottom: 7px;
}

.auth-heading p {
    margin: 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 28px rgba(20, 42, 52, 0.06);
}

h1 {
    margin-top: 0;
    font-size: 1.9rem;
    line-height: 1.15;
}

h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.muted {
    color: var(--muted);
}

/* Forms */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin: 0 0 8px;
    font-weight: 650;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(35, 111, 122, 0.12);
}

/* Password field with aligned Show/Hide */

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 72px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 54px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.password-toggle:hover {
    background: #deecee;
}

.forgot-row {
    margin-top: 9px;
    text-align: right;
    font-size: 0.93rem;
}

/* Buttons */

button,
.button {
    font: inherit;
}

.primary-button,
.button {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 12px 18px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button:hover,
.button:hover {
    background: var(--accent-dark);
}

.full-width {
    width: 100%;
}

.secondary-link {
    display: inline-block;
    margin-top: 6px;
}

.back-link-row {
    margin-top: 18px;
    text-align: center;
}

/* Alerts */

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 16px 0 22px;
}

.alert-error {
    background: #fbeaea;
    color: var(--danger);
}

.alert-success {
    background: #e8f5ee;
    color: var(--success);
}

/* Dashboard */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.stat {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0;
}

.section-title {
    margin-top: 34px;
}

.role-badge {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--muted);
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    padding: 22px 0;
    font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 600px) {
    .header-inner {
        min-height: 76px;
    }

    .brand-logo {
        width: 126px;
    }

    .auth-page .main-content {
        padding-top: 34px;
    }

    .card {
        padding: 24px 20px;
    }

    .user-name {
        display: none;
    }
}

/* Account activation page */
.activation-actions {
    margin-top: 22px;
}

.activation-actions .primary-button {
    min-height: 44px;
}

/* Shared Portal legal footer — Admin, Student, Instructor, and Auth */
.portal-footer-inner {
    display: grid;
    gap: 7px;
    text-align: center;
}

.portal-footer-copyright {
    margin: 0;
}

.portal-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.site-footer a {
    color: var(--accent-dark);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    text-decoration: underline;
}

.footer-divider {
    display: inline-block;
    margin: 0 8px;
    color: var(--border);
}

@media (max-width: 700px) {
    .portal-footer-links {
        gap: 6px 14px;
    }

    .portal-footer-links .footer-divider {
        display: none;
    }

    .portal-footer-copyright .footer-divider {
        display: none;
    }

    .portal-footer-copyright {
        line-height: 1.6;
    }
}

/* Enrollment communication timestamps */
.communication-last-sent {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin: 12px 0 0;
}

.communication-history {
    margin: 5px 0 0;
    font-size: 0.9rem;
}

