/**
 * Auth pages - Aurora Morning Gold skin.
 */

:root {
    --auth-font: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", Arial, sans-serif;
    --auth-canvas: #fbf4e5;
    --auth-canvas-soft: #fffaf0;
    --auth-card: rgba(255, 252, 244, 0.86);
    --auth-card-solid: #fffdf8;
    --auth-border: rgba(187, 132, 38, 0.28);
    --auth-border-strong: rgba(187, 132, 38, 0.42);
    --auth-text: #2c2116;
    --auth-muted: #7d6d59;
    --auth-faint: #a2937d;
    --auth-gold: #d99b16;
    --auth-gold-bright: #f4cc63;
    --auth-blue: #486a9b;
    --auth-green: #4c7558;
    --auth-shadow: 0 26px 70px rgba(92, 61, 24, 0.16);
}

body {
    font-family: var(--auth-font);
    color: var(--auth-text);
}

.auth-page {
    position: relative;
    display: block;
    align-items: initial;
    justify-content: initial;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 24px clamp(18px, 4vw, 64px) 36px;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 246, 226, 0.72) 42%, rgba(241, 220, 177, 0.34) 100%),
        linear-gradient(180deg, #fffaf0 0%, #f8efdf 54%, #f4e5cf 100%);
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-page::before {
    background:
        linear-gradient(135deg, transparent 0 18%, rgba(243, 212, 134, 0.24) 18% 19%, transparent 19% 52%, rgba(255, 255, 255, 0.55) 52% 53%, transparent 53%),
        linear-gradient(25deg, transparent 0 58%, rgba(72, 106, 155, 0.10) 58% 60%, transparent 60%);
    opacity: 0.9;
}

.auth-page::after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.5));
}

.auth-nav {
    position: relative;
    z-index: 2;
    width: min(100%, 1220px);
    margin: 0 auto 28px;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 16px;
    border: 1px solid rgba(187, 132, 38, 0.22);
    border-radius: 22px;
    background: rgba(255, 252, 244, 0.66);
    box-shadow: 0 18px 44px rgba(92, 61, 24, 0.08);
    backdrop-filter: blur(18px);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--auth-text);
}

.auth-brand:hover {
    color: var(--auth-text);
}

.auth-brand-mark,
.auth-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #6c4508;
    background: linear-gradient(145deg, rgba(255, 246, 219, 0.95), rgba(220, 157, 35, 0.9));
    border: 1px solid rgba(178, 120, 24, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 30px rgba(194, 128, 24, 0.2);
}

.auth-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.auth-brand-mark svg {
    width: 23px;
    height: 23px;
}

.auth-brand-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.auth-brand-subtitle {
    font-size: 12px;
    line-height: 1.4;
    color: var(--auth-muted);
    white-space: nowrap;
}

.auth-nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.auth-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 600;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.auth-nav-link:hover {
    color: #724b0d;
    background: rgba(243, 212, 134, 0.22);
}

.auth-nav-link.is-primary {
    color: #5f3e07;
    border: 1px solid rgba(187, 132, 38, 0.28);
    background: rgba(255, 246, 219, 0.74);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1220px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}

.auth-intro {
    min-width: 0;
    padding: clamp(20px, 3vw, 28px) 0;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(187, 132, 38, 0.28);
    border-radius: 999px;
    background: rgba(255, 252, 244, 0.66);
    color: #7d5515;
    font-size: 13px;
    font-weight: 650;
    box-shadow: 0 10px 28px rgba(92, 61, 24, 0.08);
}

.auth-intro h1 {
    margin: 18px 0 14px;
    max-width: 680px;
    color: var(--auth-text);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.16;
    font-weight: 720;
    letter-spacing: 0;
}

.auth-intro p {
    max-width: 610px;
    color: var(--auth-muted);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.8;
}

.auth-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
    max-width: 670px;
}

.auth-proof-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(187, 132, 38, 0.24);
    border-radius: 18px;
    background: rgba(255, 252, 244, 0.62);
    box-shadow: 0 14px 34px rgba(92, 61, 24, 0.07);
    backdrop-filter: blur(14px);
}

.auth-proof-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--auth-text);
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}

.auth-proof-card span {
    display: block;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.7;
}

.auth-flow {
    margin-top: 24px;
    max-width: 660px;
    display: grid;
    gap: 10px;
}

.auth-flow-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(187, 132, 38, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.36);
}

.auth-flow-index {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #664408;
    font-size: 13px;
    font-weight: 800;
    background: linear-gradient(145deg, rgba(247, 224, 162, 0.95), rgba(220, 157, 35, 0.82));
}

.auth-flow-row strong {
    display: block;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.45;
}

.auth-flow-row span {
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.6;
}

.auth-container {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.auth-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    background: var(--auth-card);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(22px);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #f5df94, #d99b16 46%, #7da4cc 100%);
}

.auth-header {
    position: relative;
    padding: 34px 34px 22px;
    text-align: left;
}

.auth-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-logo {
    width: 58px;
    height: 58px;
    margin: 0;
    border-radius: 20px;
}

.auth-logo svg {
    width: 30px;
    height: 30px;
}

.auth-title {
    margin: 0 0 5px;
    color: var(--auth-text);
    font-size: 25px;
    line-height: 1.35;
    font-weight: 700;
}

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

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 34px 8px;
    padding: 6px;
    border: 1px solid rgba(187, 132, 38, 0.2);
    border-radius: 18px;
    background: rgba(255, 248, 232, 0.7);
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 13px;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.auth-tab:hover {
    color: #6f490d;
}

.auth-tab.active {
    color: #5d3d07;
    background: linear-gradient(145deg, rgba(255, 252, 244, 0.96), rgba(245, 222, 164, 0.7));
    box-shadow: 0 10px 24px rgba(145, 91, 12, 0.12);
}

.auth-body {
    padding: 18px 34px 34px;
}

.auth-form {
    animation: authFadeUp 240ms ease both;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-label {
    margin-bottom: 8px;
    color: #4a3925;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 650;
}

.form-label.required::after {
    color: #b8671d;
}

.form-input {
    min-width: 0;
    min-height: 46px;
    padding: 12px 14px;
    color: var(--auth-text);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(164, 123, 57, 0.28);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.form-input:hover {
    border-color: rgba(164, 123, 57, 0.42);
}

.form-input:focus {
    border-color: rgba(217, 155, 22, 0.76);
    box-shadow: 0 0 0 4px rgba(243, 212, 134, 0.28);
}

.form-input::placeholder {
    color: #aa9c87;
}

.form-input.error {
    border-color: rgba(197, 70, 42, 0.72);
}

.form-error {
    min-height: 18px;
    margin-top: 6px;
    color: #b84a2f;
    font-size: 12px;
    line-height: 1.5;
}

.form-hint {
    margin-top: 7px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.65;
}

.form-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.form-input-group .form-input,
.form-input-group .btn {
    border-radius: 14px;
    margin-left: 0;
}

.form-input-group .btn {
    min-width: 112px;
    min-height: 46px;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #8c7a61;
    transform: translateY(-50%);
    transition: color 180ms ease, background 180ms ease;
}

.password-toggle:hover {
    color: #6f490d;
    background: rgba(243, 212, 134, 0.22);
}

.password-toggle svg {
    width: 19px;
    height: 19px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--auth-muted);
    font-size: 13px;
}

.form-checkbox {
    min-width: 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.form-checkbox input {
    accent-color: var(--auth-gold);
}

.text-primary,
.agreement-row a {
    color: #9b6610;
}

.text-primary:hover,
.agreement-row a:hover {
    color: #6f490d;
}

.btn {
    border-radius: 14px;
    font-weight: 650;
}

.btn-lg {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 15px;
}

.btn-primary {
    color: #472d04;
    border-color: rgba(172, 112, 15, 0.34);
    background: linear-gradient(145deg, #f9dfa0 0%, #e1a32c 55%, #c78311 100%);
    box-shadow: 0 16px 28px rgba(173, 107, 15, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-primary:hover:not(:disabled) {
    color: #3a2504;
    border-color: rgba(172, 112, 15, 0.42);
    background: linear-gradient(145deg, #ffe7ae 0%, #e7aa34 58%, #ce8a13 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    color: #6f490d;
    border-color: rgba(164, 123, 57, 0.28);
    background: rgba(255, 252, 244, 0.76);
}

.btn-secondary:hover:not(:disabled) {
    color: #5f3e07;
    border-color: rgba(164, 123, 57, 0.42);
    background: rgba(255, 246, 219, 0.92);
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading .loading-spinner {
    width: 16px;
    height: 16px;
    border-color: rgba(71, 45, 4, 0.2);
    border-top-color: #472d04;
}

.sms-captcha-group {
    margin-top: -4px;
}

.sms-captcha-group .form-input-group {
    grid-template-columns: minmax(0, 1fr) 128px auto;
}

.sms-captcha-image {
    width: 128px;
    height: 46px;
    border: 1px solid rgba(164, 123, 57, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    object-fit: cover;
    cursor: pointer;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 34px;
    color: var(--auth-faint);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(187, 132, 38, 0.22);
}

.auth-social {
    display: flex;
    gap: 12px;
    padding: 18px 34px 0;
}

.btn-social {
    flex: 1;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1f5d3b;
    border: 1px solid rgba(30, 125, 74, 0.22);
    border-radius: 14px;
    background: rgba(241, 255, 246, 0.76);
}

.btn-wechat {
    color: #0e6b3a;
    cursor: pointer;
    opacity: 1;
}

.btn-wechat:hover:not(:disabled) {
    color: #09572f;
    border-color: rgba(30, 125, 74, 0.34);
    background: rgba(227, 250, 236, 0.94);
}

.btn-wechat svg {
    color: currentColor;
    flex-shrink: 0;
}

.auth-footer {
    padding: 22px 34px 30px;
    color: var(--auth-muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
}

.auth-footer a {
    margin-left: 6px;
}

.back-to-home {
    display: none;
}

.agreement-row {
    display: grid;
    gap: 7px;
    margin: 0 0 20px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.agreement-row .form-checkbox {
    align-items: center;
}

.agreement-row .agreement-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding-left: 26px;
}

.agreement-row .agreement-links a:hover {
    text-decoration: none;
}

.step-indicator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0 34px 4px;
    padding: 14px;
    border: 1px solid rgba(187, 132, 38, 0.2);
    border-radius: 18px;
    background: rgba(255, 248, 232, 0.68);
}

.step-item {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--auth-faint);
}

.step-dot {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(164, 123, 57, 0.22);
    font-size: 13px;
    font-weight: 800;
}

.step-label {
    max-width: 100%;
    color: currentColor;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.step-line {
    height: 1px;
    background: rgba(187, 132, 38, 0.22);
}

.step-item.active,
.step-item.completed {
    color: #6f490d;
}

.step-item.active .step-dot,
.step-item.completed .step-dot {
    background: linear-gradient(145deg, rgba(247, 224, 162, 0.95), rgba(220, 157, 35, 0.84));
    border-color: rgba(164, 123, 57, 0.34);
}

.success-state {
    padding: 18px 0 8px;
    text-align: center;
}

.success-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: #326144;
    background: linear-gradient(145deg, rgba(228, 247, 235, 0.96), rgba(185, 224, 195, 0.76));
    border: 1px solid rgba(77, 117, 88, 0.24);
}

.success-state h2 {
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 21px;
}

.success-state p {
    margin: 0 0 22px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px 13px;
    border-radius: 16px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.65;
    background: rgba(255, 248, 232, 0.72);
    border: 1px solid rgba(187, 132, 38, 0.18);
}

.auth-note svg {
    flex: 0 0 auto;
    margin-top: 2px;
    color: #9b6610;
}

.agreement-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.agreement-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.agreement-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(44, 33, 22, 0.42);
    backdrop-filter: blur(8px);
}

.agreement-modal-content {
    position: relative;
    width: min(92vw, 760px);
    max-height: min(82vh, 780px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background: var(--auth-card-solid);
    box-shadow: var(--auth-shadow);
}

.agreement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(187, 132, 38, 0.2);
}

.agreement-modal-title {
    margin: 0;
    color: var(--auth-text);
    font-size: 17px;
    font-weight: 700;
}

.agreement-modal-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--auth-muted);
}

.agreement-modal-close:hover {
    color: #6f490d;
    background: rgba(243, 212, 134, 0.22);
}

.agreement-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    color: #4a3925;
    font-size: 14px;
    line-height: 1.85;
}

.agreement-modal-body h2,
.agreement-modal-body h3 {
    margin: 18px 0 10px;
    color: var(--auth-text);
    font-size: 16px;
}

.agreement-modal-body p {
    margin-bottom: 12px;
}

.agreement-modal-body ul {
    margin: 12px 0;
    padding-left: 20px;
    list-style: disc;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: start;
    }

    .auth-intro {
        padding-bottom: 0;
    }

    .auth-intro h1 {
        max-width: 720px;
    }

    .auth-intro p {
        max-width: 740px;
    }

    .auth-proof-grid {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .auth-page {
        padding: 14px 12px 24px;
    }

    .auth-nav {
        min-height: 58px;
        margin-bottom: 18px;
        padding: 10px 12px;
        border-radius: 18px;
    }

    .auth-brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }

    .auth-brand-subtitle {
        display: none;
    }

    .auth-nav-links {
        gap: 4px;
    }

    .auth-nav-link {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .auth-nav-link.optional {
        display: none;
    }

    .auth-intro h1 {
        margin-top: 14px;
        font-size: 32px;
        line-height: 1.2;
    }

    .auth-intro p {
        font-size: 15px;
        line-height: 1.75;
    }

    .auth-proof-grid {
        display: none;
    }

    .auth-flow {
        display: none;
    }

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

    .auth-header {
        padding: 28px 22px 18px;
    }

    .auth-logo {
        width: 52px;
        height: 52px;
        border-radius: 18px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-tabs {
        margin: 0 22px 6px;
    }

    .auth-body {
        padding: 18px 22px 26px;
    }

    .auth-footer {
        padding: 18px 22px 24px;
    }

    .auth-social,
    .auth-divider {
        padding-left: 22px;
        padding-right: 22px;
    }

    .form-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-input-group,
    .sms-captcha-group .form-input-group {
        grid-template-columns: 1fr;
    }

    .form-input-group .btn,
    .sms-captcha-image {
        width: 100%;
    }

    .step-indicator {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin: 0 22px;
        padding: 12px;
    }

    .step-line {
        display: none;
    }
}

@media (max-width: 420px) {
    .auth-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .auth-brand-name {
        font-size: 15px;
    }

    .auth-nav-link {
        padding: 0 8px;
    }

    .auth-kicker {
        max-width: 100%;
        font-size: 12px;
    }

    .auth-intro h1 {
        font-size: 28px;
    }

    .auth-header-main {
        align-items: flex-start;
    }
}
