/* =========================================================
   TESSERA · auth pages (sign in / sign up)
   ========================================================= */
.auth-body { overflow-x: hidden; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; width: 50%; }
.auth-back { font-size: .84rem; color: var(--ink-3); }
.auth-back:hover { color: var(--ink); }

.auth-pane { display: flex; align-items: center; justify-content: center; padding: 112px 32px 64px; position: relative; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card[hidden] { display: none; }
.auth-card.enter { animation: cardIn .6s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.auth-card h1 { font-size: 2rem; letter-spacing: -0.04em; font-weight: 500; line-height: 1.1; }
.auth-card .sub { margin-top: 8px; color: var(--ink-3); font-size: .95rem; }
.auth-card .sub b { color: var(--ink); font-weight: 500; }
.sso { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.sso .btn { height: 44px; font-size: .875rem; }
.sso .btn svg { width: 16px; height: 16px; }
.or { display: flex; align-items: center; gap: 14px; margin: 24px 0; font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-form { display: grid; gap: 16px; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }
.lbl-row a { font-size: .78rem; color: var(--ink-3); transition: color .2s; }
.lbl-row a:hover { color: var(--ink); }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3); transition: color .2s, background .2s; }
.pw-toggle:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.pw-toggle svg { width: 16px; height: 16px; }
.pw-toggle .i-off { display: none; }
.pw-toggle.on .i-on { display: none; }
.pw-toggle.on .i-off { display: block; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-row .bx { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-3); display: grid; place-items: center; flex: none; transition: background .2s, border-color .2s; }
.check-row .bx svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--ease); }
.check-row input:checked + .bx { background: var(--cobalt); border-color: var(--cobalt); }
.check-row input:checked + .bx svg { opacity: 1; transform: none; }
.check-row input:focus-visible + .bx { outline: 2px solid var(--cobalt-hi); outline-offset: 2px; }
.check-row a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.field.bad .check-row .bx { border-color: var(--coral); }
.auth-card .btn-submit { height: 46px; margin-top: 4px; }
.auth-alt { margin-top: 24px; font-size: .875rem; color: var(--ink-3); text-align: center; }
.auth-alt a { color: var(--ink); font-weight: 500; }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }
.form-err { display: none; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(240,132,111,.35); background: rgba(240,132,111,.08); color: #F7B4A6; font-size: .84rem; }
.form-err.show { display: flex; animation: shake .4s; }
.form-err svg { width: 16px; height: 16px; flex: none; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.demo-hint { margin-top: 18px; padding: 10px 12px; border-radius: 9px; border: 1px dashed var(--line-2); font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-align: center; }

/* password strength */
.meter-pw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.meter-pw i { height: 3px; border-radius: 3px; background: var(--panel-3); transition: background .3s; }
.meter-pw[data-s="1"] i:nth-child(-n+1) { background: var(--coral); }
.meter-pw[data-s="2"] i:nth-child(-n+2) { background: var(--amber); }
.meter-pw[data-s="3"] i:nth-child(-n+3) { background: var(--cobalt-hi); }
.meter-pw[data-s="4"] i { background: var(--mint); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .76rem; color: var(--ink-4); }
.pw-rules span { display: inline-flex; align-items: center; gap: 5px; transition: color .25s; }
.pw-rules span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pw-rules span.ok { color: var(--mint); }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.pick span { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); font-size: .82rem; color: var(--ink-3); transition: all .25s; }
.pick input:checked + span { color: var(--ink); border-color: rgba(124,155,255,.6); background: rgba(59,100,244,.14); }
.pick input:focus-visible + span { outline: 2px solid var(--cobalt-hi); outline-offset: 2px; }

/* steps */
.steps-ind { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.steps-ind span { display: inline-flex; align-items: center; gap: 7px; transition: color .3s; }
.steps-ind span i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-size: 10px; transition: all .3s; }
.steps-ind span.on { color: var(--ink); }
.steps-ind span.on i { border-color: var(--cobalt-hi); color: var(--cobalt-hi); }
.steps-ind span.done { color: var(--ink-2); }
.steps-ind span.done i { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.steps-ind b { flex: 1; height: 1px; background: var(--line-2); max-width: 36px; }
.plan-chip { display: inline-flex; margin-top: 14px; }

/* otp */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 28px; }
.otp input { height: 56px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); text-align: center; font-family: var(--mono); font-size: 1.4rem; transition: border-color .2s, box-shadow .2s, transform .2s; caret-color: var(--cobalt-hi); }
.otp input:focus { outline: none; border-color: rgba(124,155,255,.7); box-shadow: 0 0 0 4px rgba(59,100,244,.18); }
.otp input.filled { border-color: var(--line-3); }
.otp.bad input { border-color: rgba(240,132,111,.7); animation: shake .4s; }
.otp.ok input { border-color: rgba(60,212,154,.7); }
.resend { margin-top: 18px; font-size: .84rem; color: var(--ink-3); }
.resend button { color: var(--ink); font-weight: 500; }
.resend button:disabled { color: var(--ink-4); cursor: default; }

/* success */
.success { text-align: center; }
.success .ok { width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(60,212,154,.12); color: var(--mint); position: relative; }
.success .ok::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(60,212,154,.35); animation: ring 2s var(--ease) infinite; }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.success .ok svg { width: 30px; height: 30px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawck .7s var(--ease) .2s forwards; }
.redirect-bar { margin: 28px auto 0; height: 3px; max-width: 220px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.redirect-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cobalt), var(--cobalt-hi)); animation: fillbar 2.6s linear forwards; }
@keyframes fillbar { to { width: 100%; } }

/* right visual panel */
.auth-vis { position: relative; overflow: hidden; border-left: 1px solid var(--line); background: radial-gradient(70% 60% at 70% 30%, rgba(59,100,244,.22), transparent 70%), var(--bg-2); display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(32px, 5vw, 80px); gap: 28px; }
.auth-vis::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 70% at 60% 40%, #000, transparent 85%); mask-image: radial-gradient(70% 70% at 60% 40%, #000, transparent 85%); pointer-events: none; }
.auth-vis > * { position: relative; }
.av-live { display: inline-flex; align-self: flex-start; }
.av-title { font-size: clamp(1.8rem, 2.8vw, 2.6rem); line-height: 1.08; letter-spacing: -0.04em; font-weight: 500; max-width: 520px; }
.term { border-radius: 16px; border: 1px solid var(--line-2); background: rgba(8,9,11,.92); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4); overflow: hidden; max-width: 560px; }
.term-h { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.term-h .lights i { width: 9px; height: 9px; }
.term-b { padding: 14px 16px; height: 220px; overflow: hidden; font-family: var(--mono); font-size: 11.5px; line-height: 1.85; color: var(--ink-3); display: flex; flex-direction: column; justify-content: flex-end; }
.term-b div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rowIn .45s var(--ease); }
.term-b .g { color: var(--mint); } .term-b .b { color: var(--cobalt-hi); } .term-b .w { color: var(--ink-2); } .term-b .a { color: var(--amber); }
.perk-list { display: grid; gap: 12px; max-width: 520px; }
.perk-list li { display: flex; gap: 12px; color: var(--ink-2); font-size: .95rem; }
.rot-quote { max-width: 520px; min-height: 120px; }
.rot-quote figure { margin: 0; transition: opacity .4s, transform .5s var(--ease); }
.rot-quote figure.out { opacity: 0; transform: translateY(8px); }
.rot-quote p { font-size: 1.05rem; line-height: 1.55; color: var(--ink); letter-spacing: -0.01em; }
.rot-quote .who { margin-top: 16px; }
.rot-dots { display: flex; gap: 6px; margin-top: 16px; }
.rot-dots i { width: 18px; height: 3px; border-radius: 3px; background: var(--line-2); transition: background .3s, width .3s; }
.rot-dots i.on { background: var(--cobalt-hi); width: 28px; }
.auth-logos { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; opacity: .8; }
.auth-logos .logo { font-size: .9rem; }

@media (max-width: 1023px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-top { width: 100%; padding: 20px; }
  .auth-vis { display: none; }
  .auth-pane { padding: 96px 20px 48px; align-items: flex-start; }
}
@media (max-width: 420px) {
  .sso { grid-template-columns: 1fr; }
  .otp { gap: 6px; }
  .otp input { height: 50px; font-size: 1.2rem; }
}
