:root {
    color-scheme: dark;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0e1113;
    color: #f2f5f3;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    --auth-bg: #0e1113;
    --auth-surface: #171d1e;
    --auth-border: rgba(230, 242, 240, .1);
    --auth-text: #f2f5f3;
    --auth-muted: #899691;
    --auth-accent: #8bd1b3;
    --auth-error: #ef9d92;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(860px 560px at 12% -14%, rgba(86, 143, 118, .15), transparent 68%),
        radial-gradient(700px 620px at 100% 0, rgba(134, 161, 189, .07), transparent 70%),
        linear-gradient(180deg, #101516 0%, #0c1011 100%);
}

button, input { font: inherit; }

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 20px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0;
    width: min(100%, 420px);
    margin: 0 auto 22px;
    color: var(--auth-text);
    text-decoration: none;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.auth-card {
    width: min(100%, 420px);
    padding: 30px;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    background: rgba(23, 29, 30, .9);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .23);
}

.auth-kicker {
    margin: 0 0 6px;
    color: var(--auth-accent);
    font: 9px 'Roboto Mono', ui-monospace, monospace;
    letter-spacing: .12em;
}

.auth-card h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.auth-intro {
    margin: 7px 0 23px;
    color: var(--auth-muted);
    font-size: 12px;
}

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

.form-field { display: grid; gap: 7px; }

.form-field label {
    color: #c5d0cc;
    font-size: 11px;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid rgba(230, 242, 240, .12);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, .025);
    color: var(--auth-text);
    font-size: 12px;
    transition: border-color .16s, box-shadow .16s;
}

.form-field input:focus-visible {
    border-color: rgba(139, 209, 179, .65);
    box-shadow: 0 0 0 3px rgba(139, 209, 179, .1);
}

.form-field input[aria-invalid="true"] { border-color: rgba(239, 157, 146, .65); }

.field-error {
    margin: 0;
    color: var(--auth-error);
    font-size: 11px;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin-top: 4px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #9cddbd, #69b790);
    color: #112119;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: filter .16s, transform .16s;
}

.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 2px solid #d8f1e4; outline-offset: 3px; }
.auth-submit span { font-size: 16px; line-height: 1; }

.auth-footnote {
    margin: 18px 0 0;
    color: #73817d;
    font-size: 10px;
    text-align: center;
}

.profile-body .auth-shell {
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 26px;
}

.profile-body .auth-brand {
    width: min(100%, 880px);
    margin-bottom: 27px;
}

.profile-page {
    width: min(100%, 880px);
    margin: 0 auto;
}

.profile-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-page-heading h1 {
    margin: 0;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.profile-page-heading .auth-intro { margin: 6px 0 0; }

.profile-page-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 9px;
}

.quiet-link, .quiet-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #b2bfbb;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}

.quiet-link:hover, .quiet-button:hover { color: var(--auth-accent); }
.quiet-link:focus-visible, .quiet-button:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 4px; }

.profile-panel {
    margin-bottom: 14px;
    padding: 19px 21px;
    border: 1px solid var(--auth-border);
    border-radius: 13px;
    background: rgba(23, 29, 30, .88);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .14);
}

.profile-panel-heading { margin-bottom: 16px; }

.profile-panel-heading h2 {
    margin: 0;
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 700;
}

.profile-panel-heading p {
    margin: 4px 0 0;
    color: var(--auth-muted);
    font-size: 10px;
}

.profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.profile-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.form-hint {
    color: #73817d;
    font-size: 10px;
}

.compact-submit {
    width: auto;
    min-width: 142px;
    min-height: 37px;
    margin: 0;
    padding: 8px 13px;
}

.success-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(139, 209, 179, .2);
    border-radius: 8px;
    background: rgba(139, 209, 179, .08);
    color: #ace4c9;
    font-size: 11px;
}

@media (max-width: 480px) {
    .auth-shell { padding: 24px 16px; }
    .auth-card { padding: 24px 20px; }
}

@media (max-width: 620px) {
    .profile-body .auth-shell { padding: 22px 14px; }
    .profile-page-heading { flex-direction: column; gap: 10px; }
    .profile-page-actions { width: 100%; justify-content: space-between; padding-top: 0; }
    .profile-panel { padding: 16px; }
    .profile-fields { grid-template-columns: 1fr; gap: 14px; }
    .profile-form-actions { align-items: stretch; flex-direction: column; }
    .compact-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
