@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { --black: #050505; --white: #fff; --panel: #171717; --panel-line: rgba(255,255,255,.15); --muted: rgba(255,255,255,.55); --font-display: 'Space Grotesk', 'Arial Black', Arial, sans-serif; --font-body: 'Space Grotesk', Arial, sans-serif; --font-mono: 'DM Mono', 'Courier New', monospace; }
* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; color: var(--white); background: var(--black); font-family: var(--font-body); font-size: 1rem; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a[href] { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }
input:focus-visible { outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: .75rem; left: 1rem; z-index: 3; transform: translateY(-200%); background: var(--white); color: var(--black); padding: .7rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: translateY(0); outline-color: var(--black); }
.auth-page { min-height: 100vh; overflow-x: hidden; background: var(--black); }
.auth-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; margin: 0; padding: 1.25rem clamp(1.2rem, 2.4vw, 2.5rem) 1rem; color: var(--white); background: var(--panel); }
.auth-topbar { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.back-link { width: max-content; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .8rem; color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.08); border-radius: .55rem; font-size: .75rem; transition: background-color .2s ease, color .2s ease; }
.back-link:hover { color: var(--black); background: var(--white); }
.back-link span { font-size: 1.2rem; line-height: .75; }
.brand { display: inline-flex; align-items: center; gap: .6rem; justify-self: center; }
.brand-mark { width: 1.65rem; height: 1.65rem; display: grid; grid-template-columns: repeat(2, .54rem); grid-template-rows: repeat(2, .54rem); gap: .18rem; transform: rotate(-12deg); }
.brand-mark span { display: block; background: currentColor; border-radius: .14rem; }.brand-mark span:nth-child(2) { transform: translateY(.16rem); }.brand-mark span:nth-child(3) { transform: translateX(.13rem); }.brand-mark span:nth-child(4) { transform: translate(.16rem, -.07rem); }
.brand-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; letter-spacing: -.08em; }.brand-name em { font-style: normal; font-weight: 400; }
.brand-logo { width: 1.7rem; height: 1.7rem; object-fit: contain; }
.topbar-meta { justify-self: end; color: rgba(255,255,255,.45); font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; }
.auth-card { position: relative; width: 100%; flex: 1; display: grid; place-items: center; align-self: center; margin: 1.15rem 0; padding: clamp(2.5rem, 7vw, 5rem) 1.25rem; overflow: hidden; border: 0; border-radius: .85rem; background: radial-gradient(circle at 82% 0%, rgba(255,255,255,.12), transparent 34%), radial-gradient(circle at 0% 100%, rgba(255,255,255,.06), transparent 32%), var(--panel); }
.auth-card:before, .auth-card:after { position: absolute; content: ''; pointer-events: none; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; }.auth-card:before { width: 34rem; height: 34rem; top: -19rem; right: -8rem; }.auth-card:after { width: 25rem; height: 25rem; bottom: -16rem; left: -8rem; }
.auth-card-glow { position: absolute; top: 7%; left: 50%; width: 18rem; height: 9rem; background: rgba(255,255,255,.08); border-radius: 50%; filter: blur(55px); transform: translateX(-50%); }
.auth-content { position: relative; z-index: 1; width: min(100%, 27rem); text-align: center; }
.auth-symbol { width: 4.8rem; height: 4.8rem; display: grid; place-items: center; margin: 0 auto 1.35rem; }
.auth-symbol-logo { width: 4.5rem; height: 4.5rem; object-fit: contain; }
.auth-symbol:before { display: none; }
.auth-symbol:before { width: 1.4rem; height: 1.4rem; position: absolute; content: ''; border: 2px solid rgba(255,255,255,.35); border-radius: 50%; }.auth-symbol span { width: 1px; height: .95rem; position: absolute; background: rgba(255,255,255,.75); transform-origin: 50% 50%; }.auth-symbol span:nth-child(1) { transform: rotate(0deg); }.auth-symbol span:nth-child(2) { transform: rotate(30deg); }.auth-symbol span:nth-child(3) { transform: rotate(60deg); }.auth-symbol span:nth-child(4) { transform: rotate(90deg); }.auth-symbol span:nth-child(5) { transform: rotate(120deg); }.auth-symbol span:nth-child(6) { transform: rotate(150deg); }
.auth-eyebrow { margin: 0 0 .75rem; color: rgba(255,255,255,.45); font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; }
.auth-content h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2.15rem, 4vw, 2.8rem); line-height: 1; letter-spacing: -.07em; font-weight: 600; }
.auth-switch { margin: .8rem 0 1.8rem; color: var(--muted); font-size: .75rem; }.auth-switch a, .legal-copy a, .field-label-row a { color: var(--white); text-decoration: underline; text-underline-offset: .2rem; }.auth-switch a:hover, .legal-copy a:hover, .field-label-row a:hover { text-decoration-thickness: 2px; }
.auth-form { display: grid; gap: .8rem; text-align: left; }.field { display: grid; gap: .36rem; }.field label, .field-label-row { color: rgba(255,255,255,.62); font-size: .72rem; }.field-label-row { display: flex; justify-content: space-between; gap: .5rem; }.field-label-row a { color: rgba(255,255,255,.72); font-size: .66rem; }.field input { width: 100%; min-height: 3.35rem; padding: .8rem .95rem; color: var(--white); background: rgba(0,0,0,.14); border: 1px solid var(--panel-line); border-radius: .7rem; outline: 0; font-size: .9rem; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }.field input::placeholder { color: rgba(255,255,255,.34); }.field input:hover { background: rgba(0,0,0,.22); }.field input:focus { border-color: rgba(255,255,255,.7); background: rgba(0,0,0,.26); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }.field input.is-invalid { border-color: var(--white); box-shadow: inset 0 -3px 0 var(--white); }.field-error { min-height: .82rem; color: var(--white); font-size: .66rem; }.field-label-row + .password-wrap { margin-top: .02rem; }
.password-wrap { position: relative; }.password-wrap input { padding-right: 5rem; }.password-toggle { position: absolute; top: 50%; right: .7rem; padding: .35rem .2rem; color: rgba(255,255,255,.7); background: transparent; border: 0; font-size: .65rem; transform: translateY(-50%); }.password-toggle:hover { color: var(--white); text-decoration: underline; text-underline-offset: .18rem; }.password-toggle:focus-visible { outline: 1px solid rgba(255,255,255,.7); outline-offset: 2px; border-radius: .25rem; }
.password-rules { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin: .1rem 0 0; padding: 0; color: rgba(255,255,255,.4); font-family: var(--font-mono); font-size: .58rem; list-style: none; }.password-rules li:before { margin-right: .3rem; content: '○'; }.password-rules li.is-valid { color: var(--white); }.password-rules li.is-valid:before { content: '✓'; }
.auth-status { min-height: 1.35rem; color: var(--white); font-size: .72rem; text-align: center; }.auth-status.is-error { font-weight: 500; }.auth-status.is-success { padding: .55rem .7rem; border: 1px solid var(--panel-line); border-radius: .6rem; background: rgba(255,255,255,.06); }
.password-rules li:before { content: '○'; }.password-rules li.is-valid:before { content: '✓'; }
.auth-submit { width: 100%; min-height: 3.45rem; display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.1rem; color: var(--black); background: var(--white); border: 1px solid var(--white); border-radius: .7rem; font-size: .88rem; font-weight: 700; transition: background-color .2s ease, color .2s ease, transform .2s ease; }.auth-submit:hover { color: var(--white); background: transparent; transform: translateY(-2px); }.auth-submit:active { transform: translateY(0); }.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.magic-link, .sso-button { width: 100%; color: var(--white); background: transparent; border: 0; font-size: .72rem; }.magic-link { padding: .85rem 0 .4rem; }.magic-link:hover { text-decoration: underline; text-underline-offset: .25rem; }.auth-divider { display: flex; align-items: center; gap: .8rem; margin: .95rem 0; color: rgba(255,255,255,.38); font-family: var(--font-mono); font-size: .58rem; }.auth-divider:before, .auth-divider:after { height: 1px; flex: 1; content: ''; background: rgba(255,255,255,.1); }.sso-button { min-height: 3.05rem; padding: .75rem 1rem; border: 1px solid var(--panel-line); border-radius: .7rem; font-weight: 500; transition: background-color .2s ease, color .2s ease; }.sso-button { display: flex; justify-content: space-between; align-items: center; }.sso-button:hover { color: var(--black); background: var(--white); }.legal-copy { margin: 1.45rem auto 0; max-width: 19rem; color: rgba(255,255,255,.38); font-size: .61rem; line-height: 1.5; }.legal-copy a { color: rgba(255,255,255,.68); }
.auth-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: .85rem; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.1); font-family: var(--font-mono); font-size: .57rem; letter-spacing: .04em; }
.field-name, .field-confirm, .password-rules { display: none; }.auth-page.is-signup .field-name, .auth-page.is-signup .field-confirm, .auth-page.is-signup .password-rules { display: grid; }.auth-page.is-signup .field-confirm { margin-top: -.15rem; }.auth-page.is-signup .field-name { margin-top: -.15rem; }
@media (max-width: 640px) { .auth-shell { width: 100%; min-height: 100vh; margin: 0; padding: .9rem .75rem .8rem; }.auth-topbar { grid-template-columns: 1fr auto; }.brand { justify-self: end; }.topbar-meta { display: none; }.auth-card { margin: .85rem 0; border-radius: .8rem; padding: 3rem 1rem; }.auth-content { width: min(100%, 22rem); }.auth-footer { flex-direction: column; gap: .35rem; } }
@media (max-height: 720px) and (min-width: 641px) { .auth-shell { padding-top: .8rem; }.auth-card { padding-block: 2rem; }.auth-symbol { margin-bottom: .9rem; }.auth-switch { margin-bottom: 1rem; }.legal-copy { margin-top: .9rem; } }
@media (prefers-reduced-motion: reduce) { .back-link, .field input, .auth-submit, .sso-button { transition: none; } }

/* Responsive auth layout: the form scales with the viewport and keeps its flow at short heights. */
.auth-shell { min-height: 100svh; padding: clamp(.75rem, 1.5vw, 1.25rem) clamp(.9rem, 2.4vw, 2.5rem) 1rem; }
.auth-card { flex: 1 0 auto; min-height: max(32rem, calc(100svh - 8rem)); display: flex; align-items: center; justify-content: center; padding: clamp(1.75rem, 4vh, 4rem) clamp(1rem, 4vw, 4rem); }
.auth-content { width: min(100%, 40vw, 42rem); }
.auth-page.is-signup .auth-content { width: min(100%, 42vw, 42rem); }
.auth-symbol { width: clamp(3.5rem, 5vw, 4.8rem); height: clamp(3.5rem, 5vw, 4.8rem); margin-bottom: clamp(.8rem, 2.5vh, 1.35rem); }
.auth-symbol-logo { width: 100%; height: 100%; }
.auth-content h1 { max-width: 18ch; margin-inline: auto; font-size: clamp(2rem, 4vw, 3rem); }
.auth-switch { margin-block: clamp(.65rem, 1.8vh, .8rem) clamp(1rem, 3vh, 1.8rem); }
.auth-form { gap: clamp(.65rem, 1.5vh, .8rem); }
.field input { min-height: clamp(3rem, 5.5vh, 3.35rem); }
.auth-submit { min-height: clamp(3.1rem, 5.7vh, 3.45rem); }

@media (min-width: 801px) {
  .auth-page.is-signup .auth-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(.75rem, 2vw, 1rem); }
  .auth-page.is-signup .auth-status, .auth-page.is-signup .auth-submit { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .auth-card { min-height: 32rem; padding: 2rem .9rem; }
  .auth-content, .auth-page.is-signup .auth-content { width: min(100%, 23rem); }
  .auth-page.is-signup .auth-form { grid-template-columns: 1fr; }
  .auth-page.is-signup .auth-status, .auth-page.is-signup .auth-submit { grid-column: auto; }
}

@media (max-height: 720px) and (min-width: 641px) {
  .auth-card { min-height: 32rem; padding-block: 1.5rem; }
  .auth-symbol { margin-bottom: .8rem; }
  .auth-switch { margin-bottom: 1rem; }
  .legal-copy { margin-top: .9rem; }
}

/* Keep paired fields aligned and reserve room for live password feedback. */
.field { align-content: start; }
.password-match { min-height: .82rem; color: rgba(255,255,255,.72); font-size: .66rem; visibility: hidden; }
.password-match.is-visible { visibility: visible; }
.password-match::before { margin-right: .3rem; content: 'âœ“'; }
.password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .8rem; }
.password-rules li::before { content: '\25CB'; }
.password-rules li.is-valid::before, .password-match::before { content: '\2713'; }

@media (min-width: 801px) {
  .auth-page.is-signup .auth-form > .field { align-self: start; }
}

@media (max-width: 640px) {
  .password-rules { grid-template-columns: 1fr; }
}
