/* ============================================================
   Advarsi — dedicated login / auth pages
   Full-screen split: brand showcase (left) + auth forms (right).
   Inherits tokens, fonts and base components from styles.css.
   Crisp, squared aesthetic to match the marketing site exactly.
   ============================================================ */

html, body { height: 100%; }
body.login {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.login [hidden] { display: none !important; }

/* ---------- shell ---------- */
.lg-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ============================================================
   SHOWCASE PANEL (left)
   ============================================================ */
.lg-show {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 44px 56px 48px;
  color: #fff;
  background:
    radial-gradient(120% 80% at 8% 0%, rgba(255,255,255,.12), transparent 46%),
    radial-gradient(90% 90% at 100% 100%, var(--accent-deep, #2c3bb0), transparent 60%),
    linear-gradient(152deg, var(--accent-lite, #6E8BFF) 0%, var(--accent, #4F6EF7) 38%, var(--accent-deep, #2c3bb0) 100%);
  isolation: isolate;
}
/* faint tulip motif — flower only, centred in the panel */
.lg-show .lg-motif {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58%; z-index: 0; opacity: .16; pointer-events: none;
}
.lg-show .lg-motif svg { width: 100%; height: auto; display: block; }
.lg-show .lg-grain {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 80% at 10% 0%, #000, transparent 60%);
          mask-image: radial-gradient(120% 80% at 10% 0%, #000, transparent 60%);
}

.lg-brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 11px; }
.lg-brand .logo-mark { width: 40px; height: 40px; display: inline-flex; }
.lg-brand .logo-mark svg { width: 100%; height: 100%; display: block; box-shadow: 0 6px 18px -6px rgba(0,0,0,.5); }
.lg-brand .lg-word { font-family: var(--font-head); font-weight: 700; font-size: 23px; letter-spacing: -.02em; color: #fff; }

.lg-show-body { position: relative; z-index: 2; margin: auto 0 0; max-width: 30ch; }
.lg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: #fff; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  padding: 7px 14px; margin-bottom: 26px; backdrop-filter: blur(4px);
}
.lg-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #FFE08A; box-shadow: 0 0 0 4px rgba(255,224,138,.28); }
.lg-headline {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(34px, 3.4vw, 50px); line-height: 1.04; letter-spacing: -.03em;
  margin: 0 0 18px;
}
.lg-headline em { font-style: normal; color: #FFE08A; }
.lg-sub { font-size: 16.5px; line-height: 1.6; color: rgba(255,255,255,.84); margin: 0 0 34px; max-width: 34ch; }

.lg-feats { display: flex; flex-direction: column; gap: 15px; margin-bottom: 38px; }
.lg-feat { display: flex; align-items: center; gap: 14px; }
.lg-feat .lf-ico {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2);
  font-size: 20px; color: #fff;
}
/* animated tool glyphs in the showcase tiles: white outline + warm cream accent,
   so the two-tone logos read against the orange panel */
.lg-feat .lf-ico { --accent: #FFD9B8; }
.lg-feat .lf-ico svg { width: 22px; height: auto; color: #fff; }
.lg-feat .lf-ico .eye-iris { fill: #FFD9B8; }
.lg-feat .lf-ico .heart-fill { fill: #FFD9B8; }
.lg-feat .lf-txt b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.lg-feat .lf-txt span { font-size: 13px; color: rgba(255,255,255,.72); }

/* testimonial / stat */
.lg-quote {
  position: relative; z-index: 2;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  padding: 20px 22px; backdrop-filter: blur(6px); max-width: 38ch;
  /* Sit just below the features as part of the centred group (margin-top auto on
     the body + margin-bottom auto here split the free space), instead of being
     pinned to the very bottom of the panel. */
  margin-top: 28px; margin-bottom: auto;
}
.lg-quote p { font-size: 14.5px; line-height: 1.6; margin: 0 0 14px; color: rgba(255,255,255,.95); }
.lg-quote .lq-by { display: flex; align-items: center; gap: 11px; }
.lg-quote .lq-av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 14px;
  background: #FFE08A; color: #5b4708;
}
.lg-quote .lq-meta b { display: block; font-size: 13.5px; font-weight: 600; }
.lg-quote .lq-meta span { font-size: 12px; color: rgba(255,255,255,.7); }
.lg-quote .lq-stars { color: #FFE08A; font-size: 13px; letter-spacing: 2px; margin-bottom: 9px; }

/* ============================================================
   AUTH PANEL (right)
   ============================================================ */
.lg-auth {
  position: relative;
  display: flex; flex-direction: column;
  padding: 26px 40px;
  background: var(--bg);
  overflow-y: auto;
}
.lg-auth-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.lg-back {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 8px 12px 8px 9px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-family: inherit;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.lg-back:hover { color: var(--text); border-color: var(--text-3); }
.lg-back i { font-size: 16px; }
/* "Back to saved accounts" lives on the RIGHT, right next to the theme toggle
   (margin-left:auto pushes it + the toggle to the right; "Back to site" stays left).
   Its arrow trails on the right and points right — mirroring the left "Back to site"
   — so the padding is flipped (roomier on the text side, tighter on the icon side). */
#backToPicker { margin-left: auto; padding: 8px 9px 8px 12px; }

/* On narrow phones, let the top bar wrap to a second row instead of squishing
   the buttons — each label stays on one line (white-space:nowrap above). */
@media (max-width: 560px) {
  .lg-auth-top { flex-wrap: wrap; row-gap: 8px; }
  .lg-back { font-size: 12.5px; padding: 7px 11px; }
}

/* theme toggle (reuse marketing styles via .theme-toggle in styles.css) */

.lg-auth-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 30px 0; }
.lg-form-wrap { width: 100%; max-width: 392px; margin: 0 auto; }

/* mobile-only inline brand */
.lg-mobile-brand { display: none; }

/* tabs */
.lg-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px; margin-bottom: 28px;
}
.lg-tab {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-2);
  font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 10px;
  transition: color .2s var(--ease); cursor: pointer;
}
.lg-tab.active { color: var(--accent); }
.lg-tab-thumb {
  position: absolute; top: 5px; left: 5px; height: calc(100% - 10px); width: calc(50% - 7px);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .26s var(--ease); z-index: 0;
}
.lg-tabs[data-tab="signup"] .lg-tab-thumb { transform: translateX(calc(100% + 4px)); }

.lg-title { font-family: var(--font-head); font-size: 27px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.lg-desc { font-size: 14.5px; color: var(--text-2); margin: 8px 0 26px; line-height: 1.5; }

/* oauth */
.lg-oauth {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%;
  padding: 13px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .12s var(--ease);
}
.lg-oauth:hover { border-color: var(--text-3); background: var(--surface-2); }
.lg-oauth:active { transform: scale(.99); }
.lg-divider { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--text-3); font-size: 12px; }
.lg-divider::before, .lg-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* form */
.lg-form { display: flex; flex-direction: column; gap: 16px; }
.lg-field { display: flex; flex-direction: column; gap: 7px; }
.lg-field-label { display: flex; align-items: center; justify-content: space-between; }
.lg-field-label > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.lg-input-wrap { position: relative; display: flex; }
.lg-field input {
  width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: 14.5px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  padding: 13px 14px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.lg-field input::placeholder { color: var(--text-3); }
.lg-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.lg-field.invalid input { border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.lg-field.valid input { border-color: var(--success); }
.lg-input-wrap input { padding-right: 46px; }
.lg-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.lg-eye:hover { color: var(--text); background: var(--surface); }
.lg-eye i { font-size: 17px; }
.lg-err { font-size: 12px; color: #DC2626; display: none; }
.lg-field.invalid .lg-err { display: block; }

/* password strength */
.lg-strength { display: none; gap: 6px; align-items: center; margin-top: 2px; }
.lg-strength.show { display: flex; }
.lg-strength .bars { display: flex; gap: 4px; flex: 1; }
.lg-strength .bars i { flex: 1; height: 4px; background: var(--border); transition: background .25s var(--ease); }
.lg-strength.s1 .bars i:nth-child(1) { background: #EF4444; }
.lg-strength.s2 .bars i:nth-child(-n+2) { background: #F59E0B; }
.lg-strength.s3 .bars i:nth-child(-n+3) { background: #EAB308; }
.lg-strength.s4 .bars i { background: var(--success); }
.lg-strength .slabel { font-size: 11.5px; font-weight: 600; color: var(--text-3); min-width: 56px; text-align: right; }

/* signup password requirements hint */
.lg-pw-rules { font-size: 12px; line-height: 1.6; color: var(--text-3); margin: 8px 0 0; }
.lg-pw-rules span { color: var(--text-2); font-weight: 500; transition: color .15s var(--ease); white-space: nowrap; }
.lg-pw-rules span.ok { color: var(--success, #16a34a); font-weight: 700; }
.lg-pw-rules span.ok::before { content: "\2713 "; font-weight: 700; }

.lg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -3px; }
.lg-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.lg-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.lg-link { border: 0; background: transparent; color: var(--accent); font-family: var(--font-body); font-weight: 600; font-size: 13px; padding: 0; cursor: pointer; }
.lg-link:hover { text-decoration: underline; }
.lg-terms { font-size: 12.5px; color: var(--text-3); line-height: 1.55; margin: -4px 0 0; }
.lg-terms a { color: var(--accent); font-weight: 600; }
/* required agreement checkbox (signup) */
.lg-terms-field { margin: -2px 0 0; }
.lg-terms-check { align-items: flex-start; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.lg-terms-check input { margin-top: 1px; flex: none; }
.lg-terms-check a { color: var(--accent); font-weight: 600; }
.lg-terms-field .lg-err { margin-top: 5px; }
.lg-terms-field.invalid .lg-err { display: block; }
.lg-terms-field.invalid .lg-terms-check input { outline: 2px solid #DC2626; outline-offset: 1px; border-radius: 3px; }
.lg-terms-field.shake { animation: lgTermsShake .38s var(--ease); }
@keyframes lgTermsShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.lg-submit {
  width: 100%; margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px; padding: 14px;
  background: var(--accent); color: #fff; border: 1px solid transparent; cursor: pointer;
  box-shadow: 0 1px 2px var(--accent-ring), 0 10px 24px -12px var(--accent-ring);
  transition: background-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
}
.lg-submit:hover { background: var(--accent-press); transform: translateY(-1px); box-shadow: 0 14px 28px -12px var(--accent-ring); }
.lg-submit:active { transform: translateY(0); }
.lg-submit.loading { pointer-events: none; opacity: .82; }
.lg-submit .spin { display: none; }
.lg-submit.loading .spin { display: inline-flex; animation: lgspin .8s linear infinite; }
.lg-submit.loading .lbl, .lg-submit.loading .ti-arrow-right { display: none; }
@keyframes lgspin { to { transform: rotate(360deg); } }

.lg-foot { text-align: center; font-size: 13.5px; color: var(--text-2); margin: 22px 0 0; }
.lg-foot .lg-link { font-size: 13.5px; }

/* trust strip */
.lg-trust {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.lg-trust span { display: inline-flex; align-items: center; gap: 6px; }
.lg-trust i { font-size: 15px; color: var(--text-2); }

.lg-auth-bottom { font-size: 12px; color: var(--text-3); text-align: center; padding-top: 8px; }

/* ---------- forgot / check-email / reset views ---------- */
.lg-view { display: none; }
.lg-view.active { display: block; }
/* Entrance is a safe enhancement: resting state is always visible (opacity 1),
   we only animate when a view is switched in via JS (.lg-animate). A paused/
   throttled animation can never leave content hidden. */
.lg-view.active.lg-animate { animation: lgIn .3s var(--ease); }
@media (prefers-reduced-motion: reduce) { .lg-view.active.lg-animate { animation: none; } }
@keyframes lgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.lg-icon-badge {
  width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 22px;
  background: var(--accent-soft); color: var(--accent); font-size: 27px;
}
.lg-icon-badge.success { background: var(--success-bg); color: var(--success-text); }
.lg-mini-back {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-input, 8px); padding: 9px 14px; margin-top: 22px; cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.lg-mini-back:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }
.lg-mini-back i { font-size: 16px; }
.lg-sent-to { color: var(--text); font-weight: 600; }

/* The "Confirm your email" / "Check your inbox" screen is a status screen (no
   form) — center it for a clean, balanced look. The forgot/reset FORM views
   stay left-aligned like the login form. */
.lg-view[data-view="sent"] { text-align: center; }
.lg-view[data-view="sent"] .lg-icon-badge { margin-left: auto; margin-right: auto; }
.lg-view[data-view="sent"] .lg-desc { max-width: 40ch; margin-left: auto; margin-right: auto; }
.lg-view[data-view="sent"] .lg-resend { margin-top: 22px; }
.lg-view[data-view="sent"] .lg-mini-back { margin-top: 24px; }

/* ---------- account picker (returning users) ---------- */
.lg-accounts { display: flex; flex-direction: column; margin-top: 26px; }
.lg-acct {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 10px; background: transparent; border: 0; border-top: 1px solid var(--border);
  color: var(--text); font: inherit; cursor: pointer;
  transition: background-color .15s var(--ease);
}
.lg-acct:hover { background: var(--surface-2); }
.lg-acct:active { background: var(--accent-soft); }
.lg-acct .la-av {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  background: linear-gradient(150deg, var(--accent-lite, #6E8BFF), var(--accent, #4F6EF7));
}
.lg-acct .la-av.alt {
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-strong); font-size: 18px;
}
.lg-acct .la-meta { flex: 1; min-width: 0; }
.lg-acct .la-meta b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.lg-acct .la-meta > span { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-acct .la-meta small { display: block; font-size: 12px; color: var(--text-3); font-style: italic; margin-top: 1px; }
.lg-acct .la-action { display: grid; place-items: center; color: var(--text-3); font-size: 17px; }
.lg-acct.removing .la-action { color: var(--error, #D14343); }
.lg-acct.removing:hover { background: var(--error-bg, rgba(209,67,67,.08)); }
#removeModeBtn { border-bottom: 1px solid var(--border); }
.lg-view[data-view="picker"] .lg-foot { margin-top: 26px; }

/* resend row */
.lg-resend { font-size: 13px; color: var(--text-2); margin-top: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .lg-shell { grid-template-columns: 1fr; }
  .lg-show { display: none; }
  .lg-auth { padding: 22px 26px 34px; }
  .lg-mobile-brand {
    display: flex; align-items: center; gap: 10px; justify-content: center; margin: 8px 0 6px;
  }
  .lg-mobile-brand .logo-mark { width: 34px; height: 34px; }
  .lg-mobile-brand .logo-mark svg { width: 100%; height: 100%; }
  .lg-mobile-brand .lg-word { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--accent); letter-spacing: -.02em; }
}
@media (max-width: 460px) {
  .lg-auth { padding: 18px 18px 28px; }
  .lg-trust { gap: 12px; }
}

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 80px); background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; padding: 12px 20px; border-radius: var(--r-btn); box-shadow: var(--shadow-lg); z-index: 300; display: flex; align-items: center; gap: 9px; opacity: 0; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast i { font-size: 17px; color: var(--success); }
