/* ============================================================
   Finch — Auth pages (sign-up / log-in)
   Layered on top of styles.css; reuses the same tokens,
   .btn, .brand, .lang, and ambient-glow components.
   ============================================================ */

.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;
}

.auth {
  /* accessible muted: --text-mute (#61707F) fails WCAG AA (~3.6:1) on the dark
     surfaces; this is ~6.2:1 and used for placeholder, divider and the
     compliance disclaimer where legibility matters. */
  --mute-aa: #8b99a9;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 0;
  padding: 14px;
}

/* ---- left brand card (minimal: gradient + logo + tagline) ---- */
.auth__aside {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  background:
    radial-gradient(120% 90% at 18% 8%, #11201C 0%, #0A1019 46%, #070C13 100%);
  isolation: isolate;
}
.auth__aside-glow {
  position: absolute;
  width: 560px; height: 560px;
  left: -14%; bottom: -22%;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  background: radial-gradient(circle, rgba(33,224,138,0.42) 0%, rgba(20,190,118,0.10) 46%, transparent 70%);
  z-index: -1;
  animation: float 16s ease-in-out infinite;
}
.auth__aside-grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 100% at 20% 0%, #000 30%, transparent 78%);
}

.auth__aside-top { display: flex; align-items: center; justify-content: flex-start; }

.auth__aside-foot { max-width: 26ch; }
.auth__tagline {
  font-family: var(--font-disp);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.auth__tagline .grad-word { font-weight: 700; }
.auth__kicker {
  display: inline-block;
  font-family: var(--font-disp);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
  opacity: 0.92;
}

/* ---- right form panel ---- */
.auth__main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px clamp(16px, 4vw, 56px) 24px;
  min-height: 0;
}
.auth__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 0;
}
.auth__bar .brand { display: none; } /* shown only on mobile */
.auth__bar-right { display: flex; align-items: center; gap: 12px; }
.auth__back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-disp); font-weight: 600; font-size: 0.86rem;
  color: var(--text-dim);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  transition: border-color .2s, color .2s, background .2s;
}
.auth__back:hover { color: var(--text); border-color: var(--border-2); background: var(--surface); }
.auth__back svg { stroke: currentColor; stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.auth__back:hover svg { transform: translateX(3px); }

/* the form is vertically centred in the remaining space */
.auth__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}
.auth__form-wrap { width: 100%; max-width: 432px; margin: 0 auto; }

.auth__title {
  font-family: var(--font-disp);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 12px;
}
.auth__sub {
  color: var(--text-dim);
  font-size: 0.96rem;
  margin: 0 0 30px;
}
.auth__sub a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(33,224,138,0.35);
  padding-bottom: 1px;
  transition: border-color .2s;
}
.auth__sub a:hover { border-color: var(--green); }

/* ---- form fields ---- */
.auth__form { display: flex; flex-direction: column; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 0; position: relative; }
.field__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px 16px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  -webkit-appearance: none; appearance: none;
}
.field__input::placeholder { color: var(--mute-aa); }
.field__input:hover { border-color: var(--border-2); }
.field__input:focus {
  outline: none;
  border-color: rgba(33,224,138,0.55);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(33,224,138,0.14);
}
.field--has-icon .field__input { padding-right: 50px; }
.field.is-invalid .field__input {
  border-color: rgba(255,111,94,0.6);
  box-shadow: 0 0 0 3px rgba(255,111,94,0.12);
}

/* password show/hide */
.field__toggle {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 48px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--text-mute);
  transition: color .18s ease;
}
.field__toggle:hover { color: var(--text-dim); }
.field__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field__toggle .eye-off { display: none; }
.field__toggle.is-shown .eye-on { display: none; }
.field__toggle.is-shown .eye-off { display: block; }

.field__error {
  display: none;
  font-size: 0.8rem;
  color: var(--coral);
  margin-top: 7px;
  padding-left: 2px;
}
.field.is-invalid .field__error { display: block; }

/* terms + remember rows */
.auth__check {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 0.88rem; color: var(--text-dim);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}
.auth__check input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth__check-box {
  flex: none;
  width: 20px; height: 20px; margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: grid; place-items: center;
  transition: background .15s ease, border-color .15s ease;
}
.auth__check-box svg { width: 12px; height: 12px; fill: none; stroke: #042012; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .12s ease; }
.auth__check input:checked + .auth__check-box {
  background: var(--green);
  border-color: var(--green);
}
.auth__check input:checked + .auth__check-box svg { opacity: 1; }
.auth__check input:focus-visible + .auth__check-box { box-shadow: 0 0 0 3px rgba(33,224,138,0.22); }
.auth__check a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255,255,255,0.3); }
.auth__check a:hover { text-decoration-color: var(--green); color: var(--green); }
.auth__check.field.is-invalid .auth__check-box { border-color: rgba(255,111,94,0.7); }

.auth__row-split {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.auth__forgot {
  font-size: 0.86rem; color: var(--text-dim); font-weight: 500;
  text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.auth__forgot:hover { color: var(--green); border-color: rgba(33,224,138,0.4); }

.auth__submit { margin-top: 8px; }

/* divider */
.auth__or {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0;
  color: var(--mute-aa);
  font-size: 0.82rem;
}
.auth__or::before, .auth__or::after {
  content: ""; flex: 1; height: 1px;
  background: var(--border);
}

/* google button */
.btn--social {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-2);
  gap: 11px;
}
.btn--social:hover { background: var(--surface-2); border-color: rgba(33,224,138,0.45); transform: translateY(-2px); }
.btn--social svg { width: 19px; height: 19px; }

/* keyboard focus — clear ring for links, the language toggle and the eye button
   (inputs and the checkbox already have their own focus styles above) */
.auth a:focus-visible,
.auth .lang:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 8px;
}
.field__toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -3px;
  border-radius: 10px;
}

/* form-level success / status note */
.auth__status {
  display: none;
  align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
  padding: 13px 15px;
  border-radius: 13px;
  font-size: 0.88rem; line-height: 1.45;
  border: 1px solid rgba(33,224,138,0.32);
  background: var(--green-soft);
  color: var(--text);
}
.auth__status.is-shown { display: flex; }
.auth__status svg { flex: none; width: 18px; height: 18px; margin-top: 1px; stroke: var(--green); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.auth__status b { color: var(--green); font-weight: 700; }
.auth__status.is-error { border-color: rgba(255,111,94,0.4); background: var(--coral-soft); }
.auth__status.is-error svg { stroke: var(--coral); }
.auth__status.is-error b { color: var(--coral); }

/* footer-ish legal line under the card */
.auth__fine {
  font-size: 0.76rem; color: var(--mute-aa);
  text-align: center; margin: 22px auto 0; max-width: 432px;
  line-height: 1.5;
}

/* ============================================================
   Responsive — collapse to a single column
   ============================================================ */
@media (max-width: 880px) {
  .auth {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .auth__aside { display: none; }
  .auth__main { padding: 0 clamp(18px, 6vw, 40px) 28px; }
  .auth__bar { padding: 16px 0 0; }
  .auth__bar .brand { display: inline-flex; }
  .auth__body { padding: 26px 0 8px; }
}

@media (max-width: 440px) {
  .field-row { grid-template-columns: 1fr; }
}
