:root {
  --nq-inkwell: #2c3639;
  --nq-lunar: #3f4e4f;
  --nq-creme: #a27b5b;
  --nq-au-lait: #dcd7c9;
  --nq-canvas: #f5f3ee;
  --nq-canvas-muted: #ece9e1;
  --nq-surface: #faf9f6;
  --nq-line: rgba(44, 54, 57, 0.14);
  --nq-muted: #667073;
  --nq-accent-ink: #15191a;
  --nq-success: #355f50;
  --nq-danger: #8e3f3f;
  --nq-shadow: 0 26px 70px rgba(44, 54, 57, 0.12);
  --nq-shadow-sm: 0 14px 36px rgba(44, 54, 57, 0.08);
  --nq-radius-lg: 32px;
  --nq-radius-md: 22px;
  --nq-radius-sm: 13px;
  --nq-ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--nq-inkwell);
  background:
    radial-gradient(circle at 14% 12%, rgba(220, 215, 201, 0.82), transparent 28rem),
    radial-gradient(circle at 88% 86%, rgba(162, 123, 91, 0.08), transparent 24rem),
    var(--nq-canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: .7rem .9rem;
  border-radius: 10px;
  color: var(--nq-surface);
  background: var(--nq-inkwell);
  transform: translateY(-160%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

.auth-container {
  width: min(100% - 2rem, 1160px);
  margin-inline: auto;
}

.auth-header {
  position: relative;
  z-index: 10;
  padding: .9rem 0 0;
}

.auth-header__inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .72rem .65rem 1rem;
  border: 1px solid rgba(250, 249, 246, 0.08);
  border-radius: 20px;
  color: var(--nq-surface);
  background: rgba(44, 54, 57, 0.98);
  box-shadow: 0 18px 48px rgba(44, 54, 57, 0.16);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.auth-brand__plate {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .2rem .45rem;
}
.auth-brand img { width: 146px; height: auto; }

.auth-header__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .3rem;
  font-size: .9rem;
}
.auth-header__links a {
  padding: .72rem .82rem;
  border-radius: 11px;
  color: rgba(250, 249, 246, .78);
  text-decoration: none;
  font-weight: 700;
}
.auth-header__links a:hover { color: #fff; background: rgba(250, 249, 246, .07); }
.auth-header__links .auth-header__cta {
  margin-left: .25rem;
  color: var(--nq-accent-ink);
  background: var(--nq-creme);
}
.auth-header__links .auth-header__cta:hover { color: var(--nq-accent-ink); background: #b38966; }

.auth-main {
  flex: 1;
  display: grid;
  align-items: center;
  padding: clamp(2.2rem, 6vw, 5.6rem) 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(340px, .72fr);
  grid-template-areas: "story form";
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2rem);
}

.auth-card {
  grid-area: form;
  align-self: center;
  padding: clamp(1.45rem, 3.4vw, 2.35rem);
  border: 1px solid var(--nq-line);
  border-radius: var(--nq-radius-lg);
  background: rgba(250, 249, 246, .96);
  box-shadow: var(--nq-shadow);
}

.auth-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--nq-line);
  border-radius: 12px;
  background: var(--nq-canvas-muted);
  font-size: .78rem;
  font-weight: 800;
}
.auth-switch a,
.auth-switch span {
  min-width: 78px;
  padding: .55rem .75rem;
  border-radius: 9px;
  text-align: center;
  text-decoration: none;
}
.auth-switch a { color: var(--nq-muted); }
.auth-switch a:hover { color: var(--nq-inkwell); }
.auth-switch__active { color: var(--nq-surface); background: var(--nq-inkwell); }

.auth-card h1 {
  margin: 1.65rem 0 0;
  max-width: 12ch;
  font-size: clamp(2.35rem, 6vw, 4rem);
  line-height: .98;
  letter-spacing: -.06em;
}

.auth-intro {
  margin: .9rem 0 0;
  color: var(--nq-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.status-box {
  margin-top: 1.2rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(162, 123, 91, .26);
  border-left: 4px solid var(--nq-creme);
  border-radius: 0 12px 12px 0;
  color: var(--nq-inkwell);
  background: rgba(162, 123, 91, .08);
  font-size: .9rem;
  line-height: 1.5;
}
.status-box.error {
  border-color: rgba(142, 63, 63, .24);
  border-left-color: var(--nq-danger);
  color: #743535;
  background: rgba(142, 63, 63, .07);
}
.hidden-force { display: none !important; }

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.55rem;
}
.auth-field { display: grid; gap: .5rem; }
.auth-field label {
  color: var(--nq-lunar);
  font-size: .84rem;
  font-weight: 800;
}
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.auth-field input {
  width: 100%;
  min-height: 52px;
  padding: .9rem 1rem;
  border: 1px solid rgba(44, 54, 57, .18);
  border-radius: var(--nq-radius-sm);
  outline: none;
  color: var(--nq-inkwell);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(44, 54, 57, .02);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.auth-field input::placeholder { color: #8f9697; }
.auth-field input:hover { border-color: rgba(44, 54, 57, .3); }
.auth-field input:focus {
  border-color: var(--nq-creme);
  box-shadow: 0 0 0 4px rgba(162, 123, 91, .14);
  background: var(--nq-surface);
}

.auth-text-button {
  margin: 0;
  padding: .2rem 0;
  border: 0;
  color: var(--nq-lunar);
  background: transparent;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 800;
}
.auth-text-button:hover { color: var(--nq-creme); text-decoration: underline; text-underline-offset: 3px; }

.auth-primary {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin-top: .25rem;
  padding: .85rem 1rem;
  border: 1px solid var(--nq-inkwell);
  border-radius: var(--nq-radius-sm);
  color: var(--nq-surface);
  background: var(--nq-inkwell);
  box-shadow: 0 14px 30px rgba(44, 54, 57, .16);
  cursor: pointer;
  font-weight: 850;
  transition: transform .16s var(--nq-ease), background .16s ease, box-shadow .16s ease;
}
.auth-primary:hover { transform: translateY(-1px); background: var(--nq-lunar); box-shadow: 0 17px 34px rgba(44, 54, 57, .19); }
.auth-primary:active { transform: translateY(0); }
.auth-primary:disabled { cursor: wait; opacity: .7; transform: none; }

.spinner {
  display: block;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(250, 249, 246, .35);
  border-top-color: var(--nq-surface);
  border-radius: 50%;
  animation: auth-spin .8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-card__footer {
  display: grid;
  gap: .45rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--nq-line);
}
.auth-card__footer p {
  margin: 0;
  color: var(--nq-muted);
  font-size: .84rem;
  line-height: 1.55;
}
.auth-card__footer a { color: var(--nq-inkwell); font-weight: 800; text-underline-offset: 3px; }

.auth-story {
  grid-area: story;
  position: relative;
  overflow: hidden;
  min-height: 570px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.4rem;
  padding: clamp(1.75rem, 4vw, 3.3rem);
  border-radius: var(--nq-radius-lg);
  color: var(--nq-surface);
  background:
    linear-gradient(145deg, rgba(63, 78, 79, .42), transparent 48%),
    var(--nq-inkwell);
  box-shadow: var(--nq-shadow-sm);
}
.auth-story::after {
  content: "";
  position: absolute;
  right: -16%;
  bottom: -18%;
  width: 320px;
  aspect-ratio: 1;
  border: 1px solid rgba(220, 215, 201, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(220, 215, 201, .035), 0 0 0 78px rgba(220, 215, 201, .02);
  pointer-events: none;
}
.auth-story > * { position: relative; z-index: 1; }
.auth-story__brandline {
  margin: 0;
  color: var(--nq-au-lait);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.auth-story h2 {
  max-width: 11ch;
  margin: .9rem 0 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: .99;
  letter-spacing: -.055em;
}
.auth-story > div > p:last-child {
  max-width: 48ch;
  margin: 1.15rem 0 0;
  color: rgba(250, 249, 246, .7);
  line-height: 1.65;
}

.auth-benefits {
  display: grid;
  gap: .8rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}
.auth-benefits li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: .9rem;
  border: 1px solid rgba(250, 249, 246, .09);
  border-radius: 15px;
  background: rgba(250, 249, 246, .045);
}
.auth-benefits li > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--nq-accent-ink);
  background: var(--nq-creme);
  font-size: .78rem;
  font-weight: 900;
}
.auth-benefits strong { display: block; font-size: .9rem; }
.auth-benefits small {
  display: block;
  margin-top: .18rem;
  color: rgba(250, 249, 246, .62);
  font-size: .79rem;
  line-height: 1.45;
}
.auth-story__link {
  align-self: flex-start;
  color: var(--nq-au-lait);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 800;
}
.auth-story__link:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.auth-footer { padding: 0 0 1.2rem; }
.auth-footer__inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--nq-muted);
  font-size: .78rem;
}
.auth-footer__inner p { margin: 0; }
.auth-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.auth-footer a { text-decoration: none; }
.auth-footer a:hover { color: var(--nq-inkwell); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid rgba(162, 123, 91, .55); outline-offset: 3px; }

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "form" "story";
    max-width: 670px;
  }
  .auth-story { min-height: auto; }
  .auth-story h2 { max-width: 14ch; }
}

@media (max-width: 660px) {
  .auth-container { width: min(100% - 1.25rem, 1160px); }
  .auth-header { padding-top: .55rem; }
  .auth-header__inner { min-height: 62px; padding: .55rem .65rem; border-radius: 16px; }
  .auth-brand img { width: 122px; }
  .auth-header__links a:not(.auth-header__cta) { display: none; }
  .auth-header__links .auth-header__cta { margin-left: 0; padding: .68rem .76rem; }
  .auth-main { padding: 1.7rem 0 2.4rem; }
  .auth-card, .auth-story { border-radius: 24px; }
  .auth-card { padding: 1.25rem; }
  .auth-card h1 { margin-top: 1.35rem; font-size: clamp(2.25rem, 12vw, 3.25rem); }
  .auth-story { padding: 1.45rem; gap: 1.7rem; }
  .auth-story h2 { font-size: clamp(2rem, 10vw, 3rem); }
  .auth-footer__inner { align-items: flex-start; flex-direction: column; gap: .55rem; }
}

@media (max-width: 360px) {
  .auth-switch { width: 100%; }
  .auth-switch a, .auth-switch span { min-width: 0; }
  .auth-label-row { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .auth-text-button { min-height: 36px; }
  .auth-benefits li { grid-template-columns: 28px minmax(0, 1fr); padding: .75rem; }
  .auth-benefits li > span { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.auth-help{margin:.35rem 0 0;color:var(--nq-muted);font-size:.78rem;line-height:1.5}.field-error{display:none;color:var(--nq-danger);font-size:.78rem}.field-error.show{display:block}.auth-field input.invalid{border-color:var(--nq-danger);box-shadow:0 0 0 4px rgba(141,63,53,.1)}.auth-success{padding:1rem;border:1px solid rgba(53,95,80,.24);border-left:4px solid var(--nq-success);border-radius:0 12px 12px 0;color:#285142;background:rgba(53,95,80,.07);line-height:1.55}.auth-secondary-link{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:.7rem 1rem;border:1px solid var(--nq-line-strong);border-radius:12px;color:var(--nq-inkwell);background:transparent;text-decoration:none;font-weight:800}.auth-secondary-link:hover{background:var(--nq-canvas-muted)}
