/* ── Auth pages: login / register / reset ── */

body.active-dark-mode {
    --auth-page-bg: #0b0d12;
    --auth-card-bg: rgba(22, 24, 32, 0.92);
    --auth-card-border: rgba(255, 255, 255, 0.08);
    --auth-card-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    --auth-glow-a: rgba(5, 157, 255, 0.22);
    --auth-glow-b: rgba(251, 83, 67, 0.12);
    --auth-title: #ffffff;
    --auth-subtitle: rgba(255, 255, 255, 0.58);
    --auth-eyebrow: #5ec8ff;
    --auth-label: rgba(255, 255, 255, 0.72);
    --auth-input-bg: rgba(255, 255, 255, 0.04);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-input-text: #ffffff;
    --auth-input-placeholder: rgba(255, 255, 255, 0.32);
    --auth-input-focus-border: rgba(5, 157, 255, 0.75);
    --auth-input-focus-ring: rgba(5, 157, 255, 0.2);
    --auth-icon: rgba(255, 255, 255, 0.42);
    --auth-divider: rgba(255, 255, 255, 0.08);
    --auth-link: rgba(255, 255, 255, 0.7);
    --auth-link-hover: #5ec8ff;
    --auth-alert-danger-bg: rgba(255, 0, 3, 0.1);
    --auth-alert-danger-border: rgba(255, 0, 3, 0.28);
    --auth-alert-danger-text: #ffb4b5;
    --auth-alert-success-bg: rgba(62, 183, 94, 0.12);
    --auth-alert-success-border: rgba(62, 183, 94, 0.3);
    --auth-alert-success-text: #a7f3d0;
}

body.active-light-mode {
    --auth-page-bg: #f3f6f9;
    --auth-card-bg: #ffffff;
    --auth-card-border: #e5e9ef;
    --auth-card-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    --auth-glow-a: rgba(5, 157, 255, 0.14);
    --auth-glow-b: rgba(101, 73, 213, 0.08);
    --auth-title: #101828;
    --auth-subtitle: #667085;
    --auth-eyebrow: #059dff;
    --auth-label: #344054;
    --auth-input-bg: #f8fafc;
    --auth-input-border: #d0d5dd;
    --auth-input-text: #101828;
    --auth-input-placeholder: #98a2b3;
    --auth-input-focus-border: #059dff;
    --auth-input-focus-ring: rgba(5, 157, 255, 0.16);
    --auth-icon: #98a2b3;
    --auth-divider: #eaecf0;
    --auth-link: #475467;
    --auth-link-hover: #059dff;
    --auth-alert-danger-bg: #fef3f2;
    --auth-alert-danger-border: #fecdca;
    --auth-alert-danger-text: #b42318;
    --auth-alert-success-bg: #ecfdf3;
    --auth-alert-success-border: #abeec2;
    --auth-alert-success-text: #067647;
}

.auth-page {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 180px);
    padding: 72px 0 96px;
    background: var(--auth-page-bg);
    overflow: hidden;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(48px);
    pointer-events: none;
}

.auth-page::before {
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    top: -120px;
    left: -80px;
    background: var(--auth-glow-a);
}

.auth-page::after {
    width: min(420px, 70vw);
    height: min(420px, 70vw);
    right: -100px;
    bottom: -140px;
    background: var(--auth-glow-b);
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 16px;
}

.auth-card {
    position: relative;
    padding: 36px 28px 28px;
    border-radius: 22px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-card__header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(5, 157, 255, 0.22), rgba(101, 73, 213, 0.18));
    border: 1px solid rgba(5, 157, 255, 0.28);
    color: var(--auth-eyebrow);
    font-size: 22px;
}

.auth-card__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-eyebrow);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.auth-card__title {
    margin: 0 0 10px;
    color: var(--auth-title);
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.35;
}

.auth-card__subtitle {
    margin: 0;
    color: var(--auth-subtitle);
    font-size: 14px;
    line-height: 1.7;
}

.auth-alerts {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-alerts .alert,
.auth-card .alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    text-align: right;
}

.auth-alerts .alert-danger,
.auth-card .alert-danger {
    background: var(--auth-alert-danger-bg);
    border: 1px solid var(--auth-alert-danger-border);
    color: var(--auth-alert-danger-text);
}

.auth-alerts .alert-success,
.auth-card .alert-success {
    background: var(--auth-alert-success-bg);
    border: 1px solid var(--auth-alert-success-border);
    color: var(--auth-alert-success-text);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field__label {
    margin: 0;
    color: var(--auth-label);
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > i.auth-input-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--auth-icon);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.auth-input-wrap .toggle-password {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--auth-icon);
    font-size: 15px;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s ease;
}

.auth-input-wrap .toggle-password:hover {
    color: var(--auth-eyebrow);
}

.auth-form .auth-input,
.auth-form input.auth-input {
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 44px 0 44px;
    border: 1px solid var(--auth-input-border);
    border-radius: 14px;
    background: var(--auth-input-bg);
    color: var(--auth-input-text);
    font-size: 15px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: none;
}

.auth-form .auth-input:not([dir="ltr"]),
.auth-form input.auth-input:not([dir="ltr"]) {
    text-align: right;
}

.auth-form .auth-input[dir="ltr"],
.auth-form input.auth-input[dir="ltr"] {
    text-align: left;
    letter-spacing: 0.02em;
}

.auth-form .auth-input::placeholder,
.auth-form input.auth-input::placeholder {
    color: var(--auth-input-placeholder);
    opacity: 1;
}

.auth-form .auth-input:hover,
.auth-form input.auth-input:hover {
    border-color: var(--auth-input-focus-border);
}

.auth-form .auth-input:focus,
.auth-form input.auth-input:focus {
    border-color: var(--auth-input-focus-border);
    box-shadow: 0 0 0 4px var(--auth-input-focus-ring);
    background: var(--auth-input-bg);
}

.auth-form .auth-input.error,
.auth-form input.auth-input.error,
.auth-form .auth-input.invalid,
.auth-form label.error + .auth-input-wrap .auth-input {
    border-color: #ff5a5f;
}

.auth-form label.error {
    display: block;
    margin-top: 6px;
    color: #ff6b6f;
    font-size: 12px;
    font-weight: 500;
    text-align: right;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(95deg, #059dff 0%, #3b82f6 45%, #6549d5 100%);
    background-size: 160% 100%;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.3s ease;
    box-shadow: 0 10px 24px rgba(5, 157, 255, 0.28);
}

.auth-submit:hover {
    transform: translateY(-1px);
    background-position: 100% 0;
    box-shadow: 0 14px 28px rgba(5, 157, 255, 0.34);
    color: #fff !important;
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-card__footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-divider);
    display: grid;
    gap: 12px;
    text-align: center;
}

.auth-card__footer a {
    color: var(--auth-link);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-card__footer a:hover {
    color: var(--auth-link-hover);
}

.auth-card__footer a strong {
    color: var(--auth-eyebrow);
    font-weight: 700;
}

.auth-hint {
    margin: -4px 0 0;
    color: var(--auth-subtitle);
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
}

@media (max-width: 575px) {
    .auth-page {
        min-height: auto;
        padding: 40px 0 64px;
    }

    .auth-shell {
        padding: 0 12px;
    }

    .auth-card {
        padding: 28px 18px 22px;
        border-radius: 18px;
    }

    .auth-card__mark {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 18px;
        margin-bottom: 14px;
    }

    .auth-card__title {
        font-size: 1.3rem;
    }

    .auth-form .auth-input,
    .auth-form input.auth-input,
    .auth-submit {
        height: 50px;
        min-height: 50px;
        border-radius: 12px;
    }
}

@media (min-width: 992px) {
    .auth-page {
        padding: 88px 0 112px;
    }

    .auth-card {
        padding: 40px 36px 32px;
    }
}
