:root {
    --auth-dark: #0a0a0a;
    --auth-text: #1a1a1a;
    --auth-muted: #6f6f6f;
    --auth-accent: #905831;
    --auth-error: #922c1e;
    --font-sans: "Geist", "Microsoft YaHei", "PingFang SC", sans-serif;
    --font-display: "Special Elite", serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

html {
    background: #fff;
}

body {
    overflow-x: hidden;
    background: #fff;
    color: var(--auth-text);
    font-family: var(--font-sans);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.auth-scene {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

.background-video {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.top-fade {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    left: 0;
    height: 687px;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(100%, 1360px);
    min-height: 100vh;
    min-height: 100svh;
    flex-direction: column;
    margin: 0 auto;
}

.auth-nav {
    display: flex;
    min-height: 82px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 20px 80px 16px;
    animation: navIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.brand-mark img {
    display: block;
    width: 76%;
    height: 76%;
    object-fit: contain;
}

.brand-wordmark {
    color: #000;
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1;
    user-select: none;
}

.brand:hover .brand-mark {
    transform: scale(1.05);
}

.auth-nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.auth-nav-label {
    color: #5e5e5e;
    font-size: 13px;
    font-weight: 600;
}

.back-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 0 19px;
    border-radius: 999px;
    background: var(--auth-dark);
    color: #fafafa;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    background: #333;
    transform: translateY(-1px);
}

.back-link:active {
    transform: scale(0.96);
}

.auth-main {
    display: flex;
    min-height: calc(100svh - 82px);
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    padding: 42px 32px 68px;
}

.auth-main-compact {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: clamp(42px, 8vh, 86px);
}

.auth-main-register {
    align-items: flex-start;
    padding-top: clamp(42px, 7vh, 78px);
}

.register-layout {
    display: grid;
    width: min(100%, 1120px);
    grid-template-columns: minmax(260px, 0.72fr) minmax(560px, 1.28fr);
    align-items: start;
    gap: clamp(38px, 5vw, 72px);
}

.auth-copy {
    animation: contentIn 0.7s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-copy-register {
    padding-top: 34px;
}

.auth-copy-compact {
    width: min(100%, 700px);
    margin-bottom: 34px;
    text-align: center;
}

.eyebrow,
.panel-kicker {
    margin: 0;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: 14px;
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.auth-copy h1 {
    margin: 0 0 18px;
    color: var(--auth-text);
    font-size: 64px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.08;
}

.auth-copy-register h1 {
    font-size: 58px;
}

.auth-copy > p:last-of-type {
    margin: 0;
    color: var(--auth-muted);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.7;
}

.identity-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    color: #4d3829;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.identity-note-icon,
.panel-icon {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.identity-note-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 16px;
}

.auth-panel {
    position: relative;
    border: 3px solid #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15), 0 24px 64px rgba(42, 29, 18, 0.08);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    animation: panelIn 0.75s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-panel-register {
    width: 100%;
    padding: 30px;
    border-radius: 38px;
}

.auth-panel-compact {
    width: min(100%, 590px);
    padding: 32px;
    border-radius: 40px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.panel-kicker {
    margin-bottom: 5px;
    color: #71523c;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.panel-heading h2 {
    margin: 0;
    color: #1d1d1d;
    font-size: 23px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
}

.panel-badge {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    color: #5e402c;
    font-size: 11px;
    font-weight: 700;
}

.panel-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: #3b2c22;
    font-size: 17px;
}

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

.auth-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
}

.auth-field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.auth-field-wide {
    grid-column: 1 / -1;
}

.field-label {
    padding-left: 3px;
    color: #4c3525;
    font-size: 12px;
    font-weight: 700;
}

.auth-control {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 17px;
    outline: 0;
    background: rgba(255, 255, 255, 0.26);
    color: var(--auth-accent);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-control::placeholder {
    color: rgba(112, 67, 38, 0.58);
}

.auth-control:hover,
.auth-control:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.44);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.auth-control.is-invalid {
    border-color: rgba(146, 44, 30, 0.55);
    box-shadow: 0 0 0 2px rgba(146, 44, 30, 0.08);
}

.auth-select {
    padding-right: 38px;
    cursor: pointer;
}

.field-error {
    padding-left: 4px;
    color: var(--auth-error);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.field-hint {
    min-height: 15px;
    padding-left: 4px;
    color: #6d5544;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.captcha-field {
    gap: 8px;
}

.captcha-control-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 168px 44px;
    align-items: center;
    gap: 8px;
}

.captcha-image {
    display: block;
    width: 168px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.captcha-refresh {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: #3b2c22;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.captcha-refresh:hover {
    background: rgba(255, 255, 255, 0.52);
    transform: rotate(20deg);
}

.captcha-hint {
    padding-left: 4px;
    color: #6d5544;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.auth-form-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 4px;
}

.auth-form-actions p {
    margin: 0;
    color: #675446;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.auth-submit {
    display: inline-flex;
    min-width: 156px;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-left: auto;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-dark);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
    color: #fafafa;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover {
    background: #333;
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: scale(0.96);
}

.auth-submit-wide {
    width: 100%;
    margin-left: 0;
}

.panel-login-note {
    margin: 20px 0 0;
    color: #685342;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.panel-login-note a {
    margin-left: 4px;
    color: #1a1a1a;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.panel-login-note a:hover {
    opacity: 0.55;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.68);
    color: #614e40;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.privacy-note i {
    margin-top: 3px;
}

.auth-feedback {
    display: grid;
    gap: 6px;
    margin: -6px 0 20px;
}

.feedback-item {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.34);
    color: #513521;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.feedback-error {
    color: #8d2115;
}

.feedback-success {
    color: #1f6544;
}

.feedback-warning {
    color: #714d0e;
}

.brand:focus-visible,
.back-link:focus-visible,
.auth-control:focus-visible,
.auth-submit:focus-visible,
.panel-login-note a:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

@keyframes navIn {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1080px) {
    .auth-nav {
        padding-right: 36px;
        padding-left: 36px;
    }

    .register-layout {
        grid-template-columns: minmax(230px, 0.6fr) minmax(540px, 1.4fr);
        gap: 34px;
    }
}

@media (max-width: 900px) {
    .auth-main-register {
        padding-top: 34px;
    }

    .register-layout {
        width: min(100%, 720px);
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .auth-copy-register {
        padding-top: 0;
        text-align: center;
    }

    .auth-copy-register h1 {
        font-size: 54px;
    }

    .identity-note {
        justify-content: center;
        margin-top: 20px;
    }
}

@media (max-width: 760px) {
    .auth-nav {
        min-height: 74px;
        padding: 18px 24px 12px;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand-wordmark {
        font-size: 30px;
    }

    .auth-nav-label {
        display: none;
    }

    .back-link {
        min-height: 42px;
        padding: 0 15px;
        font-size: 13px;
    }

    .auth-main {
        min-height: calc(100svh - 74px);
        padding-right: 24px;
        padding-bottom: 48px;
        padding-left: 24px;
    }

    .auth-main-compact {
        padding-top: clamp(34px, 7vh, 58px);
    }

    .auth-copy-compact {
        margin-bottom: 28px;
    }

    .auth-copy h1 {
        font-size: 48px;
        letter-spacing: 0;
    }

    .auth-copy > p:last-of-type {
        font-size: 16px;
    }

    .auth-panel-register,
    .auth-panel-compact {
        padding: 26px;
        border-radius: 34px;
    }
}

@media (max-width: 580px) {
    .auth-main {
        padding-right: 18px;
        padding-left: 18px;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }

    .auth-field-wide {
        grid-column: auto;
    }

    .auth-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-form-actions p {
        text-align: center;
    }

    .auth-submit {
        width: 100%;
        margin-left: 0;
    }

    .captcha-control-row {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .captcha-control-row .auth-control {
        grid-column: 1 / -1;
    }

    .captcha-image {
        width: 100%;
    }

    .identity-note {
        align-items: center;
        text-align: left;
    }
}

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

    .brand-mark {
        display: none;
    }

    .brand-wordmark {
        font-size: 29px;
    }

    .back-link span {
        display: none;
    }

    .back-link {
        width: 42px;
        justify-content: center;
        padding: 0;
    }

    .auth-panel-register,
    .auth-panel-compact {
        padding: 22px;
        border-width: 2px;
        border-radius: 30px;
    }

    .panel-heading h2 {
        font-size: 21px;
    }

    .identity-note {
        font-size: 12px;
    }

    .auth-copy h1,
    .auth-copy-register h1 {
        font-size: 40px;
    }
}

@media (max-height: 720px) and (min-width: 761px) {
    .auth-main-compact {
        padding-top: 24px;
        padding-bottom: 36px;
    }

    .auth-copy-compact {
        margin-bottom: 22px;
    }

    .auth-copy-compact h1 {
        margin-bottom: 12px;
        font-size: 48px;
    }
}

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