/* ===========================================================
   ZB — authentication pages
   Loaded AFTER styles.css (reuses :root tokens, fonts, .btn).
   =========================================================== */

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ---------- Minimal header ---------- */
.auth-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 244, 242, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.auth-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.auth-header .brand { font-size: 1.2rem; }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.auth-back:hover { color: var(--rose-deep); background: var(--rose-soft); }
.auth-back svg { width: 1em; height: 1em; }

/* ---------- Split-screen shell ---------- */
.auth-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
}

/* ---------- Form column ---------- */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.1rem, 4vw, 3rem);
}
.auth-card {
  width: 100%;
  max-width: 27rem;
}
.auth-card__head { margin-bottom: var(--sp-3); }
.auth-card h1 {
  font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  margin-bottom: 0.5rem;
}
.auth-card__sub { color: var(--muted); font-size: var(--step-0); }
.auth-card__sub a { color: var(--rose-deep); font-weight: 600; }
.auth-card__sub a:hover { text-decoration: underline; }

/* ---------- SSO ---------- */
.sso { display: grid; gap: 0.7rem; margin-bottom: var(--sp-2); }
.sso--split { grid-template-columns: 1fr 1fr; }
.sso__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.78rem 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.sso__btn:hover { border-color: var(--ink-soft); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.sso__btn svg { width: 18px; height: 18px; flex: none; }
.sso--split .sso__btn { padding-inline: 0.5rem; }

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: var(--sp-2) 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Form ---------- */
.auth-form { display: grid; gap: var(--sp-2); }
.field { display: grid; gap: 0.4rem; }
.field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.field label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.field__link {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--rose-deep);
  background: none;
  padding: 0;
}
.field__link:hover { text-decoration: underline; }

.input-wrap { position: relative; display: flex; }
.field input {
  width: 100%;
  font-family: var(--body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0.82rem 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder { color: #9C948F; }
.field input:hover { border-color: #C7C0B6; }
.field input:focus-visible {
  outline: none;
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(149, 81, 92, 0.16);
}
.input-wrap:has(.pw-toggle) input { padding-right: 3rem; }

.pw-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.pw-toggle:hover { color: var(--ink); background: var(--paper-2); }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .icon-hide { display: none; }
.pw-toggle[aria-pressed="true"] .icon-show { display: none; }
.pw-toggle[aria-pressed="true"] .icon-hide { display: block; }

/* invalid state + inline error */
.field.is-invalid input {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.field.is-invalid input:focus-visible {
  box-shadow: 0 0 0 3px rgba(178, 59, 59, 0.16);
}
.field__error {
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 500;
  display: none;
}
.field__error.is-shown { display: block; }
.field-check.is-invalid input { outline: 2px solid var(--danger); outline-offset: 2px; }
.field__hint { font-size: 0.8rem; color: var(--muted); }
.field-check + .field__error { margin-top: -0.4rem; }

/* checkbox row */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.field-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex: none;
  accent-color: var(--rose-deep);
  cursor: pointer;
}
.field-check label { font-family: var(--body); font-weight: 500; cursor: pointer; }
.field-check a { color: var(--rose-deep); font-weight: 600; }
.field-check a:hover { text-decoration: underline; }

/* submit */
.auth-submit { width: 100%; margin-top: 0.2rem; }
.auth-submit[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
.auth-submit .spinner {
  width: 1.05em;
  height: 1.05em;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  display: none;
  animation: auth-spin 0.7s linear infinite;
}
.auth-submit[aria-busy="true"] .spinner { display: inline-block; }
.auth-submit[aria-busy="true"] .label-default { display: none; }
.auth-submit .label-busy { display: none; }
.auth-submit[aria-busy="true"] .label-busy { display: inline; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------- Notice (aria-live) ---------- */
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: var(--sp-2);
}
.auth-notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.auth-notice--error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: #8E2E2E;
}
.auth-notice--error svg { color: var(--danger); }
.auth-notice--success {
  background: var(--rose-soft);
  border: 1px solid #E7C7C6;
  color: var(--rose-900);
}
.auth-notice--success svg { color: var(--rose-deep); }

.auth-foot {
  margin-top: var(--sp-3);
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}
.auth-foot a { color: var(--rose-deep); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

/* ---------- Side panel (on-brand motif) ---------- */
.auth-aside {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--rose-900), var(--ink) 78%);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  padding: clamp(2.5rem, 5vw, 4.5rem);
}
.auth-aside::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -15%;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(circle at center, rgba(136, 134, 179, 0.34), rgba(136, 134, 179, 0) 70%);
  pointer-events: none;
}
.auth-aside__inner { position: relative; max-width: 25rem; }
.auth-aside .eyebrow { color: var(--rose); }
.auth-aside .eyebrow::before { background: var(--indigo-light); }
.auth-aside h2 {
  color: var(--white);
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem);
  margin: 0.9rem 0 1rem;
}
.auth-aside p { color: var(--stone); font-size: var(--step-0); line-height: 1.6; }

/* mini match-card motif reused from the hero */
.aside-card {
  position: relative;
  margin-top: var(--sp-4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(183, 110, 121, 0.28);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  backdrop-filter: blur(2px);
}
.aside-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.aside-card__label { font-size: 0.76rem; color: var(--stone); }
.aside-card__bal {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.aside-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--rose);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-pill);
}
.aside-card__delta svg { width: 12px; height: 12px; }
.aside-alloc { display: grid; gap: 0.65rem; }
.aside-alloc__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem;
}
.aside-alloc__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #E4DAD9;
}
.aside-alloc__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.aside-alloc__pct { font-family: var(--display); font-weight: 600; font-size: 0.78rem; color: var(--stone); }
.aside-alloc__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.aside-alloc__fill { display: block; height: 100%; border-radius: 5px; }

.aside-trust {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--stone);
}
.aside-trust svg { width: 18px; height: 18px; flex: none; color: var(--indigo-light); }

/* ---------- Responsive: collapse to one column ---------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding-block: clamp(1.8rem, 6vw, 3rem); }
}
@media (max-width: 420px) {
  .sso--split { grid-template-columns: 1fr; }
}
