:root {
    color-scheme: dark;
    --gold: #dfb963;
    --gold-hover: #edcc83;
    --text: #f6f4ef;
    --muted: #a4a6ae;
    --line: #36383e;
    --panel: #191b1f;
    --input: #101114;
}

html { font-size: 100%; }
@media (min-width: 1024px) and (min-height: 800px) {
    html { font-size: clamp(100%, 1.1vw, 150%); }
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background: #000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input[type="checkbox"]:focus-visible {
    outline: 0.125rem solid var(--gold);
    outline-offset: 0.25rem;
}
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 100% 0%, #30271866, transparent 55%);
}
.auth-shell {
    display: grid;
    grid-template-columns: 1.06fr 1fr;
    align-items: center;
    flex: 1;
    width: 100%;
    max-width: 100rem;
    margin: 0 auto;
    padding: 3rem clamp(1.5rem, 4vw, 3.75rem);
    gap: clamp(2.5rem, 5vw, 5.5rem);
}
.auth-hero, .auth-panel { min-width: 0; }
.hero-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: #c6bfae;
    font-size: 0.6875rem;
    line-height: 1.6;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1375rem;
    overflow-wrap: anywhere;
}
.hero-badge::before { content: ''; width: 1.25rem; height: 0.0625rem; background: var(--gold); flex-shrink: 0; }
.hero-logo { display: block; width: 25rem; max-width: 100%; height: auto; margin: 0 0 0.75rem -0.5rem; mix-blend-mode: screen; }
.hero-title { margin: 0 0 1rem; font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.14; letter-spacing: -0.0875rem; font-weight: 500; overflow-wrap: anywhere; }
.hero-title span { color: var(--gold); }
.hero-subtitle { margin: 0; color: #adaaa3; font-size: 0.875rem; line-height: 1.7; overflow-wrap: anywhere; }
.hero-features { margin: 1.625rem 0 0; border-top: 0.0625rem solid #ffffff1c; padding-top: 1.3125rem; color: #bcb7ae; font-size: 0.75rem; line-height: 2; overflow-wrap: anywhere; }
.hero-features .hero-ai { color: var(--gold); font-weight: 500; }
.auth-panel { width: 100%; max-width: 33.75rem; justify-self: end; }
.auth-card { background: var(--panel); border: 0.0625rem solid #ffffff12; border-radius: 1.125rem; padding: 2.25rem 2rem 1.875rem; box-shadow: 0 1.25rem 4.375rem #00000033; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.625rem; }
.auth-logo img { display: block; max-width: min(100%, 12.5rem); max-height: 5.25rem; width: auto; height: auto; object-fit: contain; padding: 0.5rem; border-radius: 0.5rem; background: #fff; }
.auth-card-title { margin: 0 0 0.5625rem; font-size: 1.875rem; line-height: 1.2; font-weight: 500; letter-spacing: -0.05625rem; overflow-wrap: anywhere; }
.auth-card-subtitle { margin: 0 0 1.75rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.65; overflow-wrap: anywhere; }
.auth-form { display: flex; flex-direction: column; gap: 1.3125rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5625rem; }
.form-label { color: var(--text); font-size: 0.75rem; font-weight: 500; }
.input-wrapper { display: flex; align-items: center; min-height: 3.125rem; background: var(--input); border: 0.0625rem solid var(--line); border-radius: 0.5rem; transition: border-color 150ms, box-shadow 150ms; }
.input-wrapper:focus-within { border-color: var(--gold); box-shadow: 0 0 0 0.1875rem #dfb96320; }
.input-wrapper:has([aria-invalid="true"]) { border-color: #e99595; }
.input-icon { display: flex; align-items: center; flex-shrink: 0; color: var(--muted); padding-left: 0.8125rem; }
.input-icon svg, .toggle-password svg, .alert-icon svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form-input { width: 100%; min-width: 0; flex: 1; border: 0; outline: 0; border-radius: 0.5rem; padding: 0.875rem 0.75rem; background: transparent; color: var(--text); font-size: 1rem; }
.form-input::placeholder { color: var(--muted); opacity: 1; }
.form-input:-webkit-autofill, .form-input:-webkit-autofill:hover, .form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 62.5rem var(--input) inset;
    caret-color: var(--text);
}
.toggle-password { display: flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; margin-right: 0.125rem; flex-shrink: 0; border: 0; border-radius: 0.3125rem; background: transparent; color: var(--muted); cursor: pointer; }
.toggle-password:hover { color: var(--gold); }
.form-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.375rem 0.875rem; }
.remember-check { display: flex; align-items: center; gap: 0.5rem; min-height: 2rem; color: var(--muted); font-size: 0.75rem; cursor: pointer; }
.remember-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--gold); cursor: pointer; }
.forgot-link { display: inline-flex; align-items: center; min-height: 2rem; color: var(--gold); font-size: 0.75rem; text-decoration: none; }
.forgot-link:hover { color: var(--gold-hover); text-decoration: underline; }
.auth-btn { display: flex; justify-content: center; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.125rem; border: 0; border-radius: 0.5rem; padding: 0.8125rem 1.125rem; background: var(--gold); color: #191409; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background 150ms; }
.auth-btn:hover { background: var(--gold-hover); }
.auth-btn:disabled { cursor: wait; opacity: 0.8; }
.btn-text { overflow-wrap: anywhere; min-width: 0; }
.btn-arrow { flex-shrink: 0; }
.btn-loading { display: none; align-items: center; gap: 0.5625rem; }
.spinner { width: 1.0625rem; height: 1.0625rem; border: 0.125rem solid #19140940; border-top-color: #191409; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-help { margin: 1.625rem 0 0; border-top: 0.0625rem solid var(--line); padding-top: 1.3125rem; color: var(--muted); text-align: center; font-size: 0.6875rem; line-height: 1.8; }
.auth-help span { color: var(--text); }
.auth-signature { margin: 1.5rem 0 0; color: #aaa393; text-align: center; font-size: 0.6875rem; letter-spacing: 0.1875rem; }
.auth-signature span { color: var(--gold); border-left: 0.0625rem solid #5a503a; margin-left: 0.375rem; padding-left: 0.625rem; }
.auth-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.625rem 1.5rem; border-top: 0.0625rem solid #ffffff12; padding: 1.25rem max(clamp(1.5rem, 4vw, 3.75rem), calc((100vw - 92.5rem) / 2)); color: #9a968b; font-size: 0.6875rem; line-height: 1.6; overflow-wrap: anywhere; }
.auth-footer p { margin: 0; }
.auth-alert { display: flex; gap: 0.5625rem; padding: 0.8125rem; margin-bottom: 1.375rem; border: 0.0625rem solid; border-radius: 0.5rem; font-size: 0.8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.auth-alert.success { background: #61d7a20c; border-color: #61d7a24d; color: #8ce3ba; }
.auth-alert.error { background: #f08b8b0c; border-color: #f08b8b4d; color: #f5a8a8; }
.auth-alert ul { list-style: none; margin: 0; padding: 0; }
.alert-icon { flex-shrink: 0; margin-top: 0.125rem; }
@media (max-width: 900px) {
    .auth-shell { gap: 1.875rem; padding: 2.25rem 1.75rem; }
    .auth-card { padding: 1.875rem 1.5rem 1.625rem; }
    .hero-logo { width: 18.75rem; }
    .hero-badge { font-size: 0.625rem; letter-spacing: 0.0875rem; }
    .hero-title { font-size: 2rem; }
    .auth-card-title { font-size: 1.75rem; }
}
@media (max-width: 680px) {
    .auth-shell { grid-template-columns: 1fr; gap: 1.75rem; padding: max(1.75rem, env(safe-area-inset-top)) max(1.375rem, env(safe-area-inset-right)) 1.75rem max(1.375rem, env(safe-area-inset-left)); }
    .auth-hero { max-width: 28.75rem; width: 100%; margin: 0 auto; text-align: center; }
    .hero-badge { justify-content: center; font-size: 0.625rem; margin-bottom: 0; }
    .hero-logo { width: 14.375rem; margin: 0 auto 0.25rem; }
    .hero-title { font-size: 1.8125rem; letter-spacing: -0.0625rem; }
    .hero-subtitle { font-size: 0.8125rem; }
    .hero-features { margin-top: 1.25rem; padding-top: 1rem; font-size: 0.6875rem; line-height: 1.9; }
    .auth-panel { justify-self: center; }
    .auth-card { padding: 1.75rem 1.5rem; }
    .auth-footer { padding: 1.125rem 1.375rem max(1.125rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
    .auth-shell { padding-left: 1rem; padding-right: 1rem; }
    .auth-card { padding: 1.5625rem 1.1875rem; }
    .hero-title { font-size: 1.6875rem; }
    .auth-card-title { font-size: 1.625rem; }
}
@media (pointer: coarse) {
    .remember-check, .forgot-link { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
