/* Authentication screens: navy/teal brand panel + light content panel. */
.auth { display: grid; grid-template-columns: minmax(420px, 44%) minmax(0, 1fr); min-height: 100vh; }

/* ---------- brand panel ---------- */
.auth-brand {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; padding: 52px 56px 44px;
  background:
    radial-gradient(120% 60% at 90% 20%, rgb(20 90 90 / 22%), transparent 60%),
    linear-gradient(165deg, var(--auth-brand-from) 0%, #0d2130 55%, var(--auth-brand-to) 100%);
  color: var(--auth-brand-text);
}
.auth-brand > :not(.auth-chart) { position: relative; z-index: 1; }
.auth-logo {
  display: flex; align-items: center; gap: 16px; align-self: flex-start;
  color: #fff; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none;
}
.auth-logo:hover { text-decoration: none; }
.auth-logo img { width: 52px; height: 44px; }
.auth-tagline {
  margin-top: 40px; color: var(--auth-brand-text-2); font-size: 12.5px; font-weight: 500;
  letter-spacing: .32em; text-transform: uppercase;
}
.auth-headline {
  margin-top: 64px; color: #fff; font-size: clamp(40px, 3.35vw, 56px); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em;
}
.auth-sub { margin-top: 20px; max-width: 30em; color: var(--auth-brand-text-2); font-size: 17px; line-height: 1.55; }
.auth-benefits { list-style: none; margin: auto 0 0; padding: 48px 0 0 10px; display: grid; gap: 18px; }
.auth-benefits li { display: flex; align-items: center; gap: 18px; font-size: 15px; color: var(--auth-brand-text); }
.auth-benefits .icon { width: 24px; height: 24px; color: #9fc3c9; }
.auth-foot { margin-top: 56px; color: var(--auth-brand-text-2); font-size: 15px; line-height: 1.6; }
.auth-chart {
  position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center bottom; pointer-events: none; user-select: none;
}

/* ---------- content panel (light theme via .theme-light) ---------- */
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: 32px 48px 40px; background: var(--bg); color: var(--text); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 24px; font-size: 14px; }
.auth-top a { color: var(--blue); display: inline-flex; align-items: center; gap: 8px; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 0; }
.auth-card {
  width: 100%; max-width: 472px; padding: 42px 38px 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 10px 28px rgb(16 24 40 / 6%);
}
.auth-card.wide { max-width: 580px; }
.auth-card.wide h1 { font-size: 28px; }
.auth-card h1 { font-size: 31px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.auth-card .lead { margin-top: 4px; color: var(--text-2); font-size: 16px; }
.auth-card > * + * { margin-top: 22px; }
.auth-card > h1 + .lead { margin-top: 4px; }
.auth-card .btn-lg { min-height: 50px; font-size: 15.5px; font-weight: 500; }
.auth-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2); font-size: 13px; text-align: center;
}
.auth-note .icon { width: 17px; height: 17px; color: var(--text-3); }
.auth-divider { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

/* ---------- 2FA flow variant: narrower brand panel, stacked spaced text ---------- */
.auth--steps { grid-template-columns: minmax(340px, 35%) minmax(0, 1fr); }
.auth-spaced {
  margin-top: 88px; color: var(--auth-brand-text-2); font-size: 19px; font-weight: 500;
  line-height: 1.75; letter-spacing: .3em; text-transform: uppercase;
}
.auth--steps .auth-foot { margin-top: auto; }

/* ---------- card content ---------- */
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-head .lead { margin-top: 0; }
.auth-badge {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px;
  border-radius: 12px; background: var(--green-soft); color: var(--green-text);
}
.auth-badge .icon { width: 26px; height: 26px; }
.auth-badge.warn { background: var(--amber-soft); color: var(--amber-text); }
.auth-card .alert { font-size: 14px; }
.auth-card .alert > .icon { flex-shrink: 0; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form .field { gap: 8px; }
.auth-card .field-label { color: var(--text); font-size: 14.5px; font-weight: 500; }
.auth-card .field-hint { font-size: 13px; }
.auth-card .input { min-height: 48px; padding: 11px 14px; border-radius: 7px; font-size: 15px; }
.auth-card .input-wrap > .icon { left: 15px; width: 20px; height: 20px; color: var(--text-2); }
.auth-card .input-wrap > .icon ~ .input { padding-left: 46px; }
.auth-card .input-wrap:has(.input-action) .input { padding-right: 48px; }
.auth-card .input-action { right: 8px; }
.auth-card .input.mono { font-family: var(--font-mono); letter-spacing: .04em; }
.auth-card .btn-lg { min-height: 54px; border-radius: 7px; font-size: 16px; font-weight: 500; }
.auth-card .btn-lg .icon { width: 20px; height: 20px; }
.auth-card .btn-outline { background: var(--card); }
.auth-card .btn-outline:hover:not(:disabled) { background: var(--hover); }
.auth-card .btn-outline.is-copied { border-color: var(--green-line); color: var(--green-text); }
.auth-card .auth-form + .auth-note, .auth-card > .auth-note { margin-top: 40px; }

/* "Ai uitat parola?": a <details> that works without JS */
.forgot { margin-top: -6px; text-align: right; font-size: 14px; }
.forgot summary { display: inline-block; color: var(--blue); cursor: pointer; list-style: none; border-radius: 4px; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot summary:hover { text-decoration: underline; }
.forgot p { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }

/* one-time code */
.auth-card .otp { justify-content: center; }
.auth-card .otp.large { gap: 12px; }
.auth-card .otp.large .otp-box { width: 50px; height: 56px; border-radius: 8px; font-size: 22px; }
.otp.is-invalid .otp-box { border-color: var(--red-text); }
.auth-card .otp-fallback { max-width: none; min-height: 50px; text-align: center; font-size: 18px; }
.code-switch { align-self: center; font-size: 14px; }
.code-section { display: flex; flex-direction: column; gap: 4px; }
.code-section h2 { font-size: 16px; font-weight: 600; }
.code-section .muted { font-size: 14px; }
.code-section .otp, .code-section .otp-fallback { margin-top: 18px; }

/* Google Authenticator setup */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.auth-card .steps { gap: 22px; }
.auth-card .steps > li { grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.auth-card .steps > li::before { width: 32px; height: 32px; font-size: 14px; }
.auth-card .steps > li:not(:last-child)::after { left: 15.5px; top: 38px; bottom: -18px; }
.auth-card .steps h3 { font-size: 14.5px; font-weight: 600; }
.auth-card .steps p { margin-top: 2px; font-size: 13px; line-height: 1.45; }
.qr-box {
  padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
}
.qr-box svg { display: block; width: 172px; height: 172px; }
.key-box {
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: 8px;
}
.key-groups {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px;
  color: var(--text); font-size: 14px; letter-spacing: .02em;
}
.key-copy { flex-shrink: 0; }

/* backup codes */
.auth-card .codes-grid { padding: 16px 24px; gap: 8px 32px; font-size: 14.5px; border: 1px solid var(--line); }
.auth-card .codes-grid li { white-space: nowrap; }
.codes-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.codes-actions .btn { min-height: 44px; font-size: 14px; }

/* ---------- responsive: < 900px the brand panel becomes a compact header ---------- */
@media (max-width: 899.98px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 18px 20px; }
  .auth-logo { font-size: 24px; gap: 12px; }
  .auth-logo img { width: 38px; height: 32px; }
  .auth-tagline { margin: 0; font-size: 10.5px; letter-spacing: .24em; }
  .auth-headline, .auth-sub, .auth-benefits, .auth-foot, .auth-chart, .auth-spaced { display: none; }
  .auth--steps { grid-template-columns: minmax(0, 1fr); }
  .auth-main { padding: 20px 16px 32px; }
  .auth-center { align-items: flex-start; padding: 16px 0; }
  .auth-card { padding: 28px 20px 24px; }
  .auth-card h1 { font-size: 26px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .qr-box { justify-self: center; }
  .auth-card .otp.large { gap: 8px; }
  .auth-card .otp.large .otp-box { width: 44px; height: 52px; }
  .auth-card .codes-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; padding: 14px 16px; }
  .codes-actions { grid-template-columns: minmax(0, 1fr); }
}
/* < 640px: 16px text in fields, so iOS Safari does not zoom in on focus */
@media (max-width: 639.98px) {
  .auth-card .input:not(.otp-fallback) { font-size: 16px; }
}
