:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080d11;
  color: #f5f1e8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: #080d11; }
button, input { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(28rem, .92fr);
  background:
    radial-gradient(circle at 75% 18%, rgba(213, 171, 86, .09), transparent 28rem),
    #080d11;
}

.brand-stage {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.brand-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 9, 12, .12), rgba(6, 9, 12, .3) 56%, rgba(6, 9, 12, .88)),
    linear-gradient(180deg, rgba(6, 9, 12, .05), transparent 42%, rgba(6, 9, 12, .84));
}

.brand-stage > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.84) brightness(.7) contrast(1.06);
}

.brand-mark {
  position: absolute;
  top: clamp(1.5rem, 5vw, 4rem);
  left: clamp(1.5rem, 5vw, 4.5rem);
  display: grid;
  gap: .3rem;
}

.brand-mark b { font-size: clamp(1.5rem, 2.2vw, 2.2rem); letter-spacing: -.05em; }
.brand-mark span, .eyebrow {
  color: #dfb85f;
  font: 700 .68rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand-copy {
  position: absolute;
  left: clamp(1.5rem, 5vw, 4.5rem);
  right: clamp(1.5rem, 6vw, 6rem);
  bottom: clamp(2rem, 7vw, 6rem);
  max-width: 54rem;
}

.brand-copy > p { margin: 0 0 1rem; color: #dfb85f; font-size: .76rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.brand-copy h1 { max-width: 15ch; margin: 0; font-size: clamp(3rem, 6.5vw, 6.6rem); line-height: .94; letter-spacing: -.075em; }
.brand-copy h1 em { color: #edcf8d; font-family: Georgia, serif; font-weight: 500; }
.brand-copy small { display: block; max-width: 48rem; margin-top: 1.5rem; color: rgba(240, 239, 232, .72); font-size: clamp(.86rem, 1.2vw, 1rem); line-height: 1.6; }

.auth-stage { display: grid; place-items: center; min-height: 100dvh; padding: clamp(1.25rem, 4vw, 4rem); }
.auth-card {
  position: relative;
  width: min(100%, 32rem);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 1.7rem;
  background: linear-gradient(145deg, rgba(46, 57, 65, .78), rgba(14, 21, 27, .88));
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .17), 0 2.5rem 7rem rgba(0, 0, 0, .5);
  backdrop-filter: blur(28px) saturate(120%);
}
.auth-card::before { content: ""; position: absolute; left: 14%; right: 14%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, #f2d48e, transparent); }
.security-line { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.4rem; color: #aab4b9; font-size: .76rem; }
.security-dot { width: .52rem; height: .52rem; border-radius: 50%; background: #70d3a7; box-shadow: 0 0 1rem rgba(112, 211, 167, .7); }
.auth-card h2 { margin: .45rem 0 .55rem; font-size: clamp(2.3rem, 5vw, 3.65rem); line-height: .95; letter-spacing: -.065em; }
.lede { margin: 0 0 1.5rem; color: #aeb8bd; font-size: .9rem; line-height: 1.55; }
label { display: block; margin: .95rem 0 .42rem; color: #dce0df; font: 700 .7rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .055em; text-transform: uppercase; }
input {
  width: 100%;
  min-height: 3.35rem;
  padding: .75rem .9rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: .8rem;
  outline: none;
  background: rgba(5, 10, 14, .58);
  color: #faf7f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
input:focus { border-color: #dcb762; box-shadow: 0 0 0 3px rgba(220, 183, 98, .14); }
.password-row { position: relative; }
.password-row input { padding-right: 4.5rem; }
.reveal { position: absolute; right: .45rem; top: .45rem; min-height: 2.45rem; padding: 0 .75rem; border: 0; border-radius: .55rem; background: rgba(255, 255, 255, .06); color: #d8dee0; }
.field-help { display: block; margin-top: .4rem; color: #98a3aa; font-size: .72rem; line-height: 1.45; }
.primary, .secondary, .authenticator-link {
  display: flex;
  width: 100%;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.2rem;
  border: 1px solid rgba(255, 232, 177, .62);
  border-radius: .82rem;
  background: linear-gradient(145deg, #e5c57f, #a97835);
  color: #171108;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 1px 1px 0 rgba(255, 250, 225, .7), 0 .9rem 2.2rem rgba(0, 0, 0, .3);
}
.primary:hover, .primary:focus-visible { filter: brightness(1.07); }
.secondary { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .055); color: #eef1ef; box-shadow: none; }
button:disabled { cursor: wait; opacity: .62; }
.form-status { min-height: 1.25rem; margin: .75rem 0 0; color: #ffaca0; font-size: .78rem; line-height: 1.45; }
.form-status.success { color: #7bd7ae; }
.turnstile-slot { min-height: 0; margin-top: 1rem; }
.privacy-note { display: grid; grid-template-columns: 2rem 1fr; gap: .7rem; margin-top: 1.35rem; padding: .9rem; border: 1px solid rgba(255, 255, 255, .08); border-radius: .85rem; background: rgba(2, 7, 10, .25); color: #9faab0; }
.privacy-note > span { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(221, 183, 97, .28); border-radius: .58rem; color: #e1bd70; }
.privacy-note p { margin: 0; font-size: .72rem; line-height: 1.5; }
.privacy-note b { color: #ece8df; }
.loading-state { min-height: 18rem; display: grid; place-items: center; align-content: center; gap: 1rem; color: #aeb8bd; }
.spinner { width: 2rem; height: 2rem; border: 2px solid rgba(255, 255, 255, .12); border-top-color: #dfb85f; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.secret-panel { margin: 1rem 0; padding: 1rem; border: 1px solid rgba(223, 184, 95, .24); border-radius: .85rem; background: rgba(3, 8, 11, .38); }
.secret-panel span { display: block; color: #9faab0; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.secret-panel code { display: block; margin: .55rem 0; overflow-wrap: anywhere; color: #f1d18d; font-size: .92rem; letter-spacing: .08em; }
.secret-panel button { padding: .45rem .7rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: .5rem; background: rgba(255, 255, 255, .05); color: #e8eceb; }
#recovery-codes { padding: 1rem; border: 1px solid rgba(255, 255, 255, .1); border-radius: .85rem; background: #080d11; color: #f0ce84; font: 700 .9rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.access-state { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: url("/assets/graphite-atelier-background.png") center/cover fixed; }
.access-state .auth-card { background: rgba(16, 24, 30, .92); }
.access-state h1 { margin: 0 0 .8rem; font-size: clamp(2.4rem, 6vw, 4rem); }
.access-state p { color: #bdc5c8; line-height: 1.65; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-stage { min-height: 28rem; }
  .auth-stage { min-height: auto; padding: 1rem 1rem 3rem; }
  .auth-card { margin-top: -2.5rem; }
  .brand-copy h1 { font-size: clamp(2.8rem, 11vw, 5rem); }
}

@media (max-width: 520px) {
  .brand-stage { min-height: 24rem; }
  .brand-copy small { display: none; }
  .auth-card { padding: 1.25rem; border-radius: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (prefers-reduced-transparency: reduce) { .auth-card { background: #172129; backdrop-filter: none; } }
