/* ==========================================================================
   Mailforge AI — sign in, create account, verify, complete profile.
   A full-screen, two-panel layout: the brand story on the left, one calm
   form on the right. Builds on the landing.css tokens.
   ========================================================================== */

body.auth-mode { background-image: none; }
body.auth-mode > .nav { display: none; }
body.auth-mode .acct-main { width: 100%; padding: 0; margin: 0; }
body.auth-mode #state-loading { min-height: 100vh; }

.acct-main > .auth {
  width: 100%; max-width: none; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  min-height: 100vh; min-height: 100dvh;
}

/* ── left: the brand panel ─────────────────────────────────────────────── */

.auth-art {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 40px clamp(32px, 4.6vw, 72px);
  background: #04070c; border-right: 1px solid rgba(255, 255, 255, .06);
}
.art-glow, .art-grid, .art-grain { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.art-glow {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 26% 22%, rgba(232, 163, 61, .30), transparent 70%),
    radial-gradient(34% 36% at 82% 84%, rgba(209, 59, 74, .20), transparent 70%),
    radial-gradient(30% 30% at 88% 18%, rgba(91, 155, 245, .10), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
.art-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 45% 45%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 45% 45%, #000 20%, transparent 80%);
}
.art-grain {
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.art-brand { align-self: flex-start; }

.art-middle { display: grid; gap: 40px; }
.art-middle h2 {
  margin: 0; max-width: 560px;
  font: 400 clamp(36px, 3.5vw, 54px)/1.04 var(--serif); letter-spacing: -.6px; color: #f4f7fb;
}
.art-middle h2 em { color: var(--accent); }

/* the floating example verdict */
.art-card {
  width: min(440px, 100%); padding: 18px 18px 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 50px 90px -40px rgba(0, 0, 0, .95);
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
  animation: float 8s ease-in-out infinite;
  font-size: 13px;
}
@keyframes float {
  50% { transform: perspective(1400px) rotateY(-5deg) rotateX(2deg) translateY(-8px); }
}
.ac-head { display: flex; align-items: center; gap: 11px; }
.ac-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: linear-gradient(145deg, #2f6fd6, #1d4a96); }
.ac-from { display: grid; line-height: 1.3; min-width: 0; }
.ac-from b { color: #eef3f9; font-weight: 600; }
.ac-from span { color: var(--text-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-time { margin-left: auto; color: var(--text-faint); font: 500 11.5px var(--mono); }
.ac-subj { margin: 12px 0 12px; color: var(--text); font-size: 14px; }
.ac-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-checks span { padding: 3px 9px; border-radius: 99px; font: 500 11px var(--mono);
  color: #7fd9ad; background: rgba(69, 200, 138, .08); border: 1px solid rgba(69, 200, 138, .22); }
.ac-checks span::before { content: '✓ '; }
.ac-verdict {
  display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(242, 96, 111, .14), rgba(242, 96, 111, .04));
  border: 1px solid rgba(242, 96, 111, .28);
}
.ac-score { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.ac-score svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ac-score circle { fill: none; stroke: rgba(242, 96, 111, .2); stroke-width: 3.5; }
.ac-score .fill { stroke: var(--critical); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4;
  animation: ring 1.6s .5s var(--ease) forwards; }
@keyframes ring { to { stroke-dashoffset: 9.6; } }
.ac-score b { font: 600 14px var(--mono); color: #ffb3bb; }
.ac-level { font-weight: 700; color: #ff9aa5; letter-spacing: .02em; }
.ac-why { color: var(--text-dim); font-size: 12px; line-height: 1.45; }

.art-proof { list-style: none; margin: 0; padding: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.art-proof b { display: block; font: 400 30px/1 var(--serif); color: #f4f7fb; margin-bottom: 6px; }
.art-proof span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--text-faint); }

/* ── right: the form panel ─────────────────────────────────────────────── */

.auth-panel {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  padding: 28px clamp(20px, 4vw, 56px);
  background: radial-gradient(700px 420px at 50% -10%, rgba(232, 163, 61, .06), transparent 70%), var(--bg);
}
.auth-head { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; }
.auth-brand { display: none; margin-right: auto; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-faint);
  text-decoration: none; padding: 8px 10px; border-radius: 10px; transition: color .2s, background .2s; }
.auth-back svg { width: 16px; height: 16px; }
.auth-back:hover { color: var(--text); background: rgba(255, 255, 255, .04); }

.auth-box { width: min(420px, 100%); margin: auto; padding: 36px 0; }
.view { animation: rise .5s var(--ease) both; }
.view.center { text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.auth h1 { margin: 0 0 10px; font: 400 42px/1.04 var(--serif); letter-spacing: -.5px; color: #f4f7fb; }
.auth-sub { margin: 0 0 30px; color: var(--text-dim); font-size: 15px; line-height: 1.6; }
.auth-sub b { color: var(--text); font-weight: 600; word-break: break-all; }
.step-tag { margin: 0 0 14px; font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* segmented control */
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 36px;
  border-radius: 13px; background: #0a1017; border: 1px solid #18232f;
}
.seg button {
  position: relative; z-index: 1; padding: 10px 8px; border: 0; background: none; cursor: pointer;
  font: 500 14px var(--sans); color: var(--text-faint); transition: color .25s;
}
.seg button[aria-selected="true"] { color: var(--text); }
.seg button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; border-radius: 9px; }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px;
  background: linear-gradient(180deg, #1a2532, #141d28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 8px 18px -8px rgba(0, 0, 0, .8);
  transition: transform .4s var(--ease);
}
.seg[data-mode="register"] .seg-thumb { transform: translateX(100%); }

/* fields */
.auth .field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.auth .field > label, .auth .field legend {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0;
  margin-bottom: 8px; font: 500 13px var(--sans); color: var(--text-dim);
}
.auth .field input {
  width: 100%; height: 50px; padding: 0 15px; border-radius: 12px;
  font: 400 15px var(--sans); color: var(--text);
  background: #0a1017; border: 1px solid #1b2734; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth .field input::placeholder { color: #4d5d70; }
.auth .field input:hover { border-color: #283748; }
.auth .field input:focus {
  outline: none; border-color: rgba(232, 163, 61, .75); background: #0c131c;
  box-shadow: 0 0 0 4px rgba(232, 163, 61, .12);
}
.auth .field input[aria-invalid="true"] { border-color: rgba(242, 96, 111, .7); box-shadow: 0 0 0 4px rgba(242, 96, 111, .10); }
/* Browser autofill paints fields light. Keep our colours in every state --
   including focus, where the focus ring used to replace the cover. */
.auth .field input:-webkit-autofill,
.auth .field input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0a1017 inset; box-shadow: 0 0 0 1000px #0a1017 inset;
  transition: background-color 600000s 0s, color 600000s 0s;
}
.auth .field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0c131c inset, 0 0 0 4px rgba(232, 163, 61, .12);
  box-shadow: 0 0 0 1000px #0c131c inset, 0 0 0 4px rgba(232, 163, 61, .12);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--text-faint);
  display: grid; place-items: center; transition: color .2s, background .2s;
}
.pw-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.pw-toggle svg { width: 19px; height: 19px; }

.text-link { border: 0; background: none; padding: 0; cursor: pointer; font: 500 13px var(--sans); color: var(--accent-2); }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* password strength */
.strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: 10px; }
.strength i { height: 3px; border-radius: 99px; background: #18232f; transition: background .3s; }
.strength span { min-width: 54px; text-align: right; font-size: 12px; color: var(--text-faint); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--critical); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--high); }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--medium); }
.strength[data-score="4"] i:nth-child(-n+4) { background: var(--pass); }

/* account type */
.type-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-card {
  position: relative; display: grid; gap: 2px; padding: 13px 12px 12px; border-radius: 12px; cursor: pointer;
  background: #0a1017; border: 1px solid #1b2734;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease);
}
.type-card:hover { border-color: #2a3a4c; transform: translateY(-1px); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card svg { width: 20px; height: 20px; color: var(--text-faint); margin-bottom: 8px; transition: color .2s; }
.type-card b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.type-card small { font-size: 11.5px; color: var(--text-faint); line-height: 1.35; }
.type-card:has(input:checked) {
  border-color: rgba(232, 163, 61, .7); background: linear-gradient(180deg, rgba(232, 163, 61, .10), rgba(232, 163, 61, .03));
  box-shadow: 0 0 0 3px rgba(232, 163, 61, .10);
}
.type-card:has(input:checked) svg { color: var(--accent); }
.type-card:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* buttons */
.btn-auth {
  position: relative; width: 100%; height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 15px var(--sans); color: var(--accent-ink);
  background: linear-gradient(180deg, #f2b856, #e19a2e);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 14px 30px -14px rgba(232, 163, 61, .8);
  transition: transform .25s var(--ease), filter .2s, box-shadow .25s;
}
.btn-auth:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn-auth[disabled] { cursor: default; filter: saturate(.7) brightness(.85); transform: none; }
.btn-auth.busy span { visibility: hidden; }
.btn-auth.busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid rgba(26, 18, 6, .3); border-top-color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn-auth.ghost { color: var(--text); background: #0d141d; border: 1px solid #223042; box-shadow: none; }
.btn-auth.ghost:hover { background: #111a25; border-color: #2e3f53; filter: none; }
.btn-auth.ghost.busy::after { border-color: rgba(255, 255, 255, .2); border-top-color: var(--text); }

.auth .btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 50px; padding: 0; border-radius: 12px; cursor: pointer;
  font: 500 15px var(--sans); color: var(--text);
  background: #0d141d; border: 1px solid #223042;
  transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.auth .btn-google:hover { background: #111a25; border-color: #2e3f53; transform: translateY(-1px); }
.auth .btn-google svg { width: 20px; height: 20px; }

.auth .or { margin: 26px 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #4d5d70; }
.auth .or::before, .auth .or::after { background: #18232f; }

.auth .form-msg { margin: 0 0 14px; min-height: 0; font-size: 13.5px; line-height: 1.5; }
.auth .form-msg:empty { display: none; }
.auth .form-msg.bad { color: #ff8f9b; }
.auth .form-msg.ok { color: #7fd9ad; }
.auth .form-msg .text-link { font-size: inherit; }
.auth-fine { margin: 18px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-faint); }
.auth-fine a { color: var(--text-dim); }
.auth-fine .text-link { font-size: inherit; }

.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 28px; padding: 6px 8px 6px 2px;
  border: 0; background: none; cursor: pointer; font: 500 13.5px var(--sans); color: var(--text-faint); }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--text); }

/* verify */
.verify-icon {
  position: relative; width: 72px; height: 72px; margin: 0 auto 26px; border-radius: 22px;
  display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(180deg, rgba(232, 163, 61, .16), rgba(232, 163, 61, .05));
  border: 1px solid rgba(232, 163, 61, .3);
}
.verify-icon::after { content: ''; position: absolute; inset: -1px; border-radius: 22px;
  border: 1px solid rgba(232, 163, 61, .5); animation: halo 2.4s ease-out infinite; }
@keyframes halo { to { inset: -14px; border-radius: 30px; opacity: 0; } }
.verify-icon svg { width: 32px; height: 32px; }
.wait-line { display: inline-flex; align-items: center; gap: 10px; margin: -8px 0 26px; font-size: 13.5px; color: var(--text-faint); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(232, 163, 61, .6);
  animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(232, 163, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0); } }
#view-verify .form-msg { margin: 14px 0 0; }

.auth .invite-note { margin-bottom: 26px; }

.auth-foot { text-align: center; font-size: 12.5px; color: #4d5d70; }
.auth-foot a { color: var(--text-faint); text-decoration: none; }
.auth-foot a:hover { color: var(--text); }

/* ── smaller screens ─────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .acct-main > .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-head { justify-content: space-between; }
  .auth-brand { display: flex; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 18px 16px; }
  .auth-box { padding: 28px 0; }
  .auth h1 { font-size: 36px; }
  .auth-back span { display: none; }
  .type-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .type-card { grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; }
  .type-card svg { grid-row: span 2; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .art-glow, .art-card, .verify-icon::after, .pulse, .view { animation: none; }
  .ac-score .fill { animation: none; stroke-dashoffset: 9.6; }
  .seg-thumb { transition: none; }
}

/* keep notices over the form, not the artwork */
@media (min-width: 1081px) { body.auth-mode .toast { left: 76%; } }

/* plan choice (registration) */
.plan-list { display: grid; gap: 10px; margin-bottom: 18px; }
.plan-opt {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: start;
  padding: 14px 16px; border-radius: 14px; cursor: pointer; background: #0a1017; border: 1px solid #1b2734;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease);
}
.plan-opt:hover { border-color: #2a3a4c; transform: translateY(-1px); }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt:has(input:checked) {
  border-color: rgba(232, 163, 61, .7); background: linear-gradient(180deg, rgba(232, 163, 61, .10), rgba(232, 163, 61, .03));
  box-shadow: 0 0 0 3px rgba(232, 163, 61, .10);
}
.plan-opt:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.plan-opt .po-name { font-size: 15px; font-weight: 600; color: var(--text); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-opt .po-badge { padding: 2px 8px; border-radius: 99px; font: 500 10.5px var(--mono); letter-spacing: .04em;
  color: var(--accent); background: rgba(232, 163, 61, .12); }
.plan-opt .po-badge.offer { color: #7ee2a8; background: rgba(46, 204, 113, .12); }
.plan-opt .po-price { text-align: right; font: 600 15px var(--sans); color: var(--text); white-space: nowrap; }
.plan-opt .po-price s { color: var(--text-faint); font-weight: 400; font-size: 12.5px; margin-right: 4px; }
.plan-opt .po-price small { display: block; font: 400 11.5px var(--sans); color: var(--text-faint); }
.plan-opt .po-sum { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.45; color: var(--text-faint); }
.opt { color: var(--text-faint); font-weight: 400; }
.next-icon { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: rgba(232, 163, 61, .12); }
.next-icon svg { width: 28px; height: 28px; }
.auth-legal { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-faint); text-align: center; }
.auth-legal a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }

/* reward codes */
.reward-toggle { margin: 2px 0 6px; font-size: 13.5px; }
.reward-note { border-color: rgba(232, 163, 61, .45); background: rgba(232, 163, 61, .08); }
.reward-box { margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; border: 1px dashed rgba(232, 163, 61, .45);
  background: rgba(232, 163, 61, .05); }
.reward-box > label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.reward-row { display: flex; gap: 8px; }
.reward-row input { flex: 1; min-width: 0; font-family: var(--mono, ui-monospace, monospace); letter-spacing: .04em; }
.auth .reward-row input { height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid #1b2734;
  background: #0a1017; color: var(--text); font-size: 15px; outline: none; }
.auth .reward-row input:focus { border-color: rgba(232, 163, 61, .7); box-shadow: 0 0 0 4px rgba(232, 163, 61, .12); }
.auth .reward-row input[aria-invalid="true"] { border-color: rgba(242, 96, 111, .7); }
.btn-apply { flex: none; height: 50px; padding: 0 20px; border-radius: 12px; border: 1px solid rgba(232, 163, 61, .6);
  background: transparent; color: #f2c46b; font: 600 14px var(--sans, inherit); cursor: pointer; }
.btn-apply:hover { background: rgba(232, 163, 61, .1); }
.btn-apply:disabled { opacity: .6; cursor: progress; }
.reward-box .form-msg:empty { display: none; }
.reward-note .rw-code { display: inline-block; white-space: nowrap; margin: 0 2px; font: 600 12.5px var(--mono, ui-monospace, monospace);
  color: #f2c46b; letter-spacing: .03em; }

/* keep me signed in */
.keep { display: flex; align-items: center; gap: 9px; margin: 2px 0 4px; font-size: 13.5px; color: var(--text-dim); cursor: pointer;
  user-select: none; }
.keep input { width: 16px; height: 16px; accent-color: #e8a33d; margin: 0; }
/* plan picker */
.plan-back { display: inline-block; margin: 0 0 18px; font-size: 13.5px; }
.plan-note { margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.55;
  color: var(--text-dim); background: rgba(232, 163, 61, .07); border: 1px solid rgba(232, 163, 61, .25); }
.plan-note b { color: var(--text); }
.btn-auth:disabled { opacity: .55; cursor: not-allowed; }

