:root {
    --brand-primary: #565db3;
    --brand-bright: #47a7eb;
    --brand-deep: #25587e;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.93);
    --border: rgba(86, 93, 179, 0.18);
    --text-main: #1c2455;
    --text-muted: #586785;
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow: 0 24px 60px rgba(33, 57, 102, 0.16);
    --transition: 260ms ease;
}


body[data-theme="dark"] {
    --surface: rgba(18, 26, 48, 0.8);
    --surface-strong: rgba(19, 29, 56, 0.94);
    --border: rgba(117, 149, 214, 0.26);
    --text-main: #e8efff;
    --text-muted: #a6b6d4;
    --shadow: 0 24px 60px rgba(2, 6, 20, 0.5);
    background:
        radial-gradient(circle at top right, rgba(71, 167, 235, 0.18), transparent 28%),
        radial-gradient(circle at top left, rgba(86, 93, 179, 0.24), transparent 24%),
        linear-gradient(180deg, #0a1327, #111f3f);
}

body[data-theme="dark"] .country-picker-trigger {
    border-color: rgba(117, 149, 214, 0.24);
    background: linear-gradient(180deg, rgba(28, 40, 73, 0.96), rgba(20, 30, 56, 0.94));
    color: var(--text-main);
}

body[data-theme="dark"] .country-picker-panel {
    border-color: rgba(117, 149, 214, 0.2);
    background: rgba(15, 24, 46, 0.98);
    box-shadow: 0 22px 40px rgba(2, 6, 20, 0.45);
}

body[data-theme="dark"] .country-picker-search {
    border-color: rgba(117, 149, 214, 0.14);
    background: rgba(117, 149, 214, 0.08);
}

body[data-theme="dark"] .country-picker-search input {
    color: var(--text-main);
}

body[data-theme="dark"] .country-flag {
    background: rgba(117, 149, 214, 0.14);
}

body[data-theme="dark"] .country-option:hover,
body[data-theme="dark"] .country-option.is-selected {
    background: rgba(117, 149, 214, 0.12);
}

body[data-theme="dark"] .country-picker-empty {
    background: rgba(117, 149, 214, 0.08);
    color: var(--text-muted);
}

* {
    box-sizing: border-box;
}

[hidden],
[data-grade-row][hidden],
[data-subject-row][hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Cairo", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(71, 167, 235, 0.2), transparent 28%),
        radial-gradient(circle at top left, rgba(86, 93, 179, 0.22), transparent 24%),
        linear-gradient(180deg, #f5f8ff, #eaf0ff);
}

html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] button,
html[lang="ar"] textarea,
html[lang="ar"] label,
html[lang="ar"] a {
    font-family: "Cairo", sans-serif;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.auth-card {
    width: min(100%, 1080px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
    overflow: hidden;
}

.auth-brand {
    background:
        linear-gradient(145deg, rgba(86, 93, 179, 0.94), rgba(71, 167, 235, 0.88));
    color: #fff;
    padding: 34px 28px;
    display: grid;
    align-content: center;
    gap: 14px;
}

.brand-chip {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.14);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.auth-brand h1 {
    margin: 0;
    line-height: 1.35;
    font-size: clamp(1.8rem, 2.2vw, 2.3rem);
}

.auth-brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.85;
}

.brand-badges {
    display: grid;
    gap: 8px;
}

.brand-badges span {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    font-weight: 700;
    font-size: 0.92rem;
}

.auth-panel {
    padding: 28px;
    display: grid;
    gap: 14px;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auth-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-icon-btn,
.auth-home-link,
.theme-toggle-btn {
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(86, 93, 179, 0.2);
    background: var(--surface-strong);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.auth-icon-btn,
.auth-home-link {
    text-decoration: none;
}

.auth-home-link:hover,
.auth-icon-btn:hover {
    transform: translateY(-2px);
    background: rgba(86, 93, 179, 0.12);
}

.theme-toggle-btn {
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    background: rgba(86, 93, 179, 0.12);
}

.theme-toggle-btn i {
    font-size: 1rem;
}

.auth-toggle {
    position: relative;
    width: min(100%, 390px);
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(86, 93, 179, 0.2);
    background: rgba(86, 93, 179, 0.08);
    padding: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.auth-toggle-btn {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-family: "Cairo", sans-serif;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.auth-toggle-indicator {
    position: absolute;
    top: 5px;
    width: calc(50% - 8px);
    height: calc(100% - 10px);
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid rgba(86, 93, 179, 0.22);
    transition: transform var(--transition);
    right: 5px;
}

.auth-card.is-register .auth-toggle-indicator {
    transform: translateX(calc(-100% - 6px));
}

.alert {
    border-radius: var(--radius-sm);
    border: 1px solid;
    padding: 10px 12px;
    line-height: 1.7;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.alert.error {
    background: rgba(220, 20, 60, 0.08);
    border-color: rgba(220, 20, 60, 0.35);
    border-inline-start: 5px solid #b1183e;
    color: #8c1031;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    font-weight: 700;
    flex-wrap: wrap;
    box-shadow: 0 10px 24px rgba(160, 18, 54, 0.12);
}

.alert.error::before {
    content: "!";
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #c3264f, #9e1f41);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(150, 24, 56, 0.28);
}

.alert.error > div {
    width: calc(100% - 34px);
}

.alert.success {
    background: linear-gradient(135deg, rgba(22, 93, 49, 0.14), rgba(64, 179, 114, 0.1));
    border-color: rgba(18, 115, 64, 0.42);
    border-inline-start: 5px solid #1a8f56;
    color: #0f4c2c;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(16, 90, 49, 0.12);
}

.alert.success::before {
    content: "\2713";
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #1a8f56, #157446);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(18, 103, 59, 0.28);
}

.auth-panels {
    position: relative;
    min-height: 0;
    display: grid;
    align-content: start;
    overflow: visible;
}

.auth-card.is-register .auth-panels {
    min-height: 0;
}

.auth-form {
    position: relative;
    inset: auto;
    display: none;
    align-content: start;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition);
}

.auth-form.is-active {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.auth-form .alert {
    width: 100%;
    grid-column: 1 / -1;
    margin: 0 0 2px;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    word-break: break-word;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.form-row label {
    font-weight: 700;
    font-size: 0.95rem;
}

.form-row input,
.form-row select {
    min-height: 48px;
    width: 100%;
    border: 1px solid rgba(86, 93, 179, 0.2);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text-main);
    padding: 0 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.password-input-wrap input {
    padding-right: 12px;
    padding-left: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(86, 93, 179, 0.08);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(86, 93, 179, 0.08);
    transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--brand-primary);
    background: rgba(86, 93, 179, 0.14);
    outline: none;
}

.form-row select {
    padding-inline-end: 36px;
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(71, 167, 235, 0.15);
}

.alert.error > div + div {
    margin-top: 4px;
}

[data-grade-row] {
    transition: opacity 180ms ease, transform 180ms ease;
}


[data-grade-row][hidden] {
    display: none !important;
}
.submit-btn {
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-bright));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(86, 93, 179, 0.26);
    transition: transform 220ms ease;
    font-family: "Cairo", sans-serif;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    color: var(--text-muted);
    font-weight: 700;
    font-family: "Cairo", sans-serif;
    font-size: 0.92rem;
    opacity: 0.95;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(to left, rgba(86, 93, 179, 0.08), rgba(86, 93, 179, 0.32), rgba(86, 93, 179, 0.08));
}

.auth-divider span {
    min-width: 28px;
    text-align: center;
}

.auth-links {
    margin-top: auto;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.auth-links a {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(86, 93, 179, 0.16);
    background: rgba(86, 93, 179, 0.08);
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-family: "Cairo", sans-serif;
}

.google-btn {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(86, 93, 179, 0.22);
    background: var(--surface-strong);
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    font-weight: 700;
    font-family: "Cairo", sans-serif;
    transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
    margin-bottom: 8px;
}

.auth-form-register .google-btn {
    margin-bottom: 0;
}

.google-btn:hover {
    transform: translateY(-2px);
    background: rgba(86, 93, 179, 0.1);
    border-color: rgba(86, 93, 179, 0.35);
    box-shadow: 0 10px 22px rgba(33, 57, 102, 0.12);
}

.dashboard-card {
    width: min(100%, 760px);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
}

.dashboard-card h2,
.dashboard-card p {
    margin: 0;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-actions a {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(86, 93, 179, 0.18);
    background: rgba(86, 93, 179, 0.08);
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

[data-fade] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 440ms ease, transform 440ms ease;
}

[data-fade].is-visible {
    opacity: 1;
    transform: none;
}

.country-picker {
    position: relative;
    z-index: 4;
}

.country-picker-trigger {
    width: 100%;
    min-height: 52px;
    border: 1px solid rgba(86, 93, 179, 0.2);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 255, 0.92));
    color: var(--text-main);
    padding: 0 14px;
    font: inherit;
    font-family: "Cairo", sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.country-picker-trigger:hover {
    transform: translateY(-1px);
}

.country-picker.is-open .country-picker-trigger,
.country-picker-trigger:focus-visible {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(71, 167, 235, 0.15);
    outline: none;
}

.country-picker-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.country-picker-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.country-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(86, 93, 179, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.country-picker-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 30;
    border: 1px solid rgba(86, 93, 179, 0.18);
    border-radius: 20px;
    background: var(--surface-strong);
    box-shadow: 0 22px 40px rgba(33, 57, 102, 0.18);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.country-picker-panel[hidden] {
    display: none !important;
}

.country-picker-search {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(86, 93, 179, 0.14);
    background: rgba(86, 93, 179, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.country-picker-search input {
    border: 0;
    background: transparent;
    color: var(--text-main);
    width: 100%;
    min-width: 0;
    outline: none;
    font: inherit;
    font-family: "Cairo", sans-serif;
}

.country-picker-list {
    max-height: 260px;
    overflow: auto;
    display: grid;
    gap: 6px;
    padding-inline-end: 2px;
}

.country-option {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-main);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    font: inherit;
    font-family: "Cairo", sans-serif;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.country-option:hover,
.country-option.is-selected {
    background: rgba(86, 93, 179, 0.1);
}

.country-option:hover {
    transform: translateX(-2px);
}

.country-option-name {
    flex: 1;
    font-weight: 700;
}

.country-option i {
    opacity: 0;
    color: var(--brand-primary);
}

.country-option.is-selected i {
    opacity: 1;
}

.country-option[hidden] {
    display: none !important;
}

.country-picker-empty {
    padding: 14px 12px;
    border-radius: 14px;
    background: rgba(86, 93, 179, 0.06);
    color: var(--text-muted);
    text-align: center;
    font-weight: 700;
}

@media (max-width: 980px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-brand,
    .auth-panel {
        padding: 22px;
    }

    .auth-panels { min-height: 0; }

    .auth-card.is-register .auth-panels {
        min-height: 840px;
    }

    .form-grid-wide {
        grid-template-columns: 1fr 1fr;
    }

    .auth-form .google-btn {
        order: -3;
        margin-bottom: 2px;
    }

    .auth-form .auth-divider {
        order: -2;
        margin: 0;
    }
}

@media (max-width: 640px) {
    .auth-panel {
        padding: 18px;
    }

    .auth-toggle-btn {
        min-height: 38px;
        font-size: 0.9rem;
    }

    .theme-toggle-btn {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .auth-home-link {
        width: 42px;
        height: 42px;
        min-height: 42px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-panels {
        min-height: auto;
    }

    .auth-form {
        position: static;
        inset: auto;
        display: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .auth-form.is-active {
        display: grid;
    }

    .alert {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .auth-topbar {
        gap: 8px;
        align-items: flex-start;
    }

    .auth-toggle {
        width: 100%;
    }

    .auth-top-actions {
        flex-shrink: 0;
    }

    .country-picker-panel {
        padding: 10px;
    }

    .password-input-wrap input {
        padding-left: 48px;
    }

    .password-toggle {
        left: 7px;
        width: 34px;
        height: 34px;
    }

    .auth-card.is-register .auth-panels { min-height: 0; }
}

body[data-theme="dark"] .alert.error {
    background: linear-gradient(180deg, rgba(122, 22, 45, 0.92), rgba(86, 16, 34, 0.96));
    border-color: rgba(255, 145, 170, 0.42);
    border-inline-start-color: rgba(255, 145, 170, 0.95);
    color: #ffe8ee;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .alert.success {
    background: linear-gradient(180deg, rgba(20, 93, 56, 0.94), rgba(13, 68, 40, 0.96));
    border-color: rgba(118, 247, 180, 0.4);
    border-inline-start-color: rgba(132, 255, 193, 0.95);
    color: #eafff2;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .alert.success::before {
    background: linear-gradient(180deg, #42c88a, #2ea16c);
    color: #062213;
}

body[data-theme="dark"] .alert.error::before {
    background: linear-gradient(180deg, #ff7da0, #de5177);
    color: #2c0713;
}

.alert.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
}

.form-row {
    align-content: start;
}

.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error .country-picker-trigger {
    border-color: rgba(220, 20, 60, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.12) !important;
}

.form-row.has-error .password-toggle {
    color: #b1183e;
}

.field-error {
    min-height: 18px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    color: #b1183e;
    padding-inline: 2px;
}

body[data-theme="dark"] .field-error {
    color: #ffb7c8;
}

body[data-theme="dark"] .password-toggle {
    background: rgba(117, 149, 214, 0.12);
    box-shadow: inset 0 0 0 1px rgba(117, 149, 214, 0.12);
}

body[data-theme="dark"] .password-toggle:hover,
body[data-theme="dark"] .password-toggle:focus-visible {
    background: rgba(117, 149, 214, 0.2);
}
.phone-row {
    align-content: start;
}

.phone-field-group {
    display: grid;
    grid-template-columns: minmax(104px, 118px) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    direction: ltr;
    border: 1px solid rgba(86, 93, 179, 0.2);
    border-radius: 14px;
    background: var(--surface-strong);
    overflow: hidden;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.phone-field-group:focus-within {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(71, 167, 235, 0.15);
}

.phone-code-box {
    position: relative;
    background: rgba(86, 93, 179, 0.08);
    border-inline-end: 1px solid rgba(86, 93, 179, 0.16);
}

.phone-code-box::after {
    content: "";
    position: absolute;
    inset: 8px 8px 8px auto;
    width: 1px;
    background: rgba(86, 93, 179, 0.14);
    display: none;
}

.phone-code-select {
    direction: ltr;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 52px;
    padding-inline: 6px 18px;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
}

.phone-code-select option {
    color: #1c2455;
    background: #f8fbff;
}

body[data-theme="dark"] .phone-code-box {
    background: rgba(117, 149, 214, 0.12);
    border-inline-end-color: rgba(117, 149, 214, 0.22);
}

body[data-theme="dark"] .phone-code-select {
    color: var(--text-main);
}

body[data-theme="dark"] .phone-code-select option {
    color: #e8efff;
    background: #172442;
}

.phone-number-input {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 52px;
    padding-inline: 14px;
}

.form-row.has-error .phone-field-group {
    border-color: rgba(220, 20, 60, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.12) !important;
}

.field-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    padding-inline: 2px;
}

.google-btn {
    width: 100%;
    margin-top: 0;
}

.auth-form-register {
    gap: 12px;
}

@media (max-width: 640px) {
    .auth-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .phone-field-group {
        grid-template-columns: 116px minmax(0, 1fr);
    }

    .phone-code-select {
        min-height: 50px;
        padding-inline: 6px 16px;
        font-size: 0.84rem;
    }

    .auth-toggle {
        width: 100%;
        max-width: none;
    }

    .auth-top-actions {
        align-self: flex-end;
    }
}

.subject-select {
    font-family: 'Font Awesome 6 Free', 'Cairo', sans-serif;
    font-weight: 900;
}

.subject-select option {
    font-family: 'Font Awesome 6 Free', 'Cairo', sans-serif;
    font-weight: 900;
}

.redirect-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(245, 248, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 240ms ease, visibility 240ms ease;
}

.redirect-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.redirect-loader-card {
    width: min(100%, 320px);
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    padding: 24px 22px;
    border-radius: 22px;
    border: 1px solid rgba(86, 93, 179, 0.18);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 50px rgba(33, 57, 102, 0.18);
}

.redirect-loader-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(86, 93, 179, 0.14);
    border-top-color: var(--brand-primary);
    border-right-color: var(--brand-bright);
    animation: redirectLoaderSpin 0.9s linear infinite;
}

.redirect-loader-title {
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--text-main);
}

.redirect-loader-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

body[data-theme="dark"] .redirect-loader {
    background: rgba(10, 19, 39, 0.68);
}

body[data-theme="dark"] .redirect-loader-card {
    background: rgba(19, 29, 56, 0.94);
    border-color: rgba(117, 149, 214, 0.22);
    box-shadow: 0 28px 56px rgba(2, 6, 20, 0.45);
}

@keyframes redirectLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

