/* No blue tap flash on phones */
html { -webkit-tap-highlight-color: transparent; }
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }

/* ============================================================================
   ClipAd — auth pages (login + signup), redesigned 2026-10-01.
   Split screen: dark form pane on the left, a rounded gradient panel on the
   right. Gradient colours are the homepage ones: the hero motif / benefits
   tints (peach #f4c3a2, mulberry tint #EDB3CB, mint #bfe0d3) plus the brand orange.
   Self-contained on purpose — these pages do not load dashboard.css.
   ========================================================================== */

:root {
  --au-bg: #141414;
  --au-ink: #f8f2ed;
  --au-muted: #a79c94;
  --au-line: rgba(248, 242, 237, 0.16);
  --au-line-strong: rgba(248, 242, 237, 0.3);
  --au-orange: #FF5900;
  --au-white: #fff;
  --au-hl: rgba(244, 195, 162, 0.25);   /* hover / focus border: soft peach, quarter strength */
  --au-danger: #ff8a7a;
  --au-ok: #8fd3b0;
  --au-sans: 'Season Digits', 'Plus Jakarta Sans', system-ui, sans-serif;
  --au-head: 'Season Sans', 'Season Digits', 'Plus Jakarta Sans', sans-serif;
}

body.auth {
  margin: 0;
  min-height: 100vh;
  background: var(--au-bg);
  color: var(--au-ink);
  font-family: var(--au-sans);
  -webkit-font-smoothing: antialiased;
}
body.auth *, body.auth *::before, body.auth *::after { box-sizing: border-box; }

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* ── Form pane ───────────────────────────────────────────────────────────── */
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-col { width: 100%; max-width: 350px; }

.auth-logo { display: block; width: 52px; height: 52px; margin-bottom: 32px; border-radius: 12px; }
.auth-col h1 {
  margin: 0 0 8px;
  font-family: var(--au-head);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--au-ink);
}
.auth-sub:empty { height: 0; margin: 0 0 24px; }
.auth-sub { margin: 0 0 28px; font-size: 14.5px; line-height: 1.5; color: var(--au-muted); }

.auth-note {
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  background: rgba(248, 242, 237, 0.07);
  color: var(--au-ink);
}
.auth-note.success { background: rgba(143, 211, 176, 0.14); color: var(--au-ok); }

/* ── Social buttons (markup/behaviour owned by /dashboard/js/social-auth.js) ── */
.social-auth { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.social-btn {
  position: relative;
  display: flex; align-items: center; justify-content: flex-start;
  width: 100%; height: 44px; padding: 0 16px 0 44px;
  border-radius: 999px;
  border: 1px solid var(--au-line);
  background: transparent;
  color: var(--au-ink);
  font: 600 14.5px/1 var(--au-sans);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, opacity .15s ease;
}
.social-btn:hover { border-color: var(--au-hl); background: rgba(255, 255, 255, 0.04); }
.social-btn:focus-visible { outline: none; border-color: var(--au-hl); background: rgba(255, 255, 255, 0.05); }
.social-btn svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; display: block; }
.social-btn.is-soon { opacity: .5; }
.social-btn.is-soon:hover { background: transparent; border-color: var(--au-line); color: var(--au-ink); }
.social-btn:disabled { opacity: .6; cursor: progress; }
.social-hint {
  margin: 10px 0 0; min-height: 1.3em; text-align: center;
  font-size: 13px; color: var(--au-muted);
  opacity: 0; transition: opacity .15s ease;
}
.social-hint:empty { display: none; }
.social-hint.is-visible { opacity: 1; }
.social-hint.is-error { color: var(--au-danger); font-weight: 500; }

.social-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 16px;
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--au-muted);
}
.social-divider::before, .social-divider::after { content: ''; flex: 1; height: 1px; background: var(--au-line); }

/* ── Fields ──────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--au-ink); }
.form-group input {
  width: 100%; height: 44px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(248, 242, 237, 0.07);
  color: var(--au-ink);
  font: 400 14.5px/1 var(--au-sans);
  transition: border-color .15s ease, background-color .15s ease;
}
.form-group input::placeholder { color: var(--au-muted); opacity: .8; }
.form-group input:hover { background: rgba(248, 242, 237, 0.08); }
.form-group input:focus {
  outline: none; border-color: var(--au-hl);
  background: rgba(248, 242, 237, 0.09);
}
.form-group input:-webkit-autofill {
  -webkit-text-fill-color: var(--au-ink);
  box-shadow: 0 0 0 40px #1f1f1f inset;
}
.form-hint { margin: 0; font-size: 12.5px; color: var(--au-muted); }

/* pw-toggle.js wraps password inputs in .pw-field and appends .pw-toggle */
.pw-field { position: relative; }
.pw-field input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--au-muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--au-ink); background: rgba(248, 242, 237, 0.08); }
.pw-toggle:focus-visible { outline: none; color: var(--au-ink); background: rgba(255, 255, 255, 0.07); }
.pw-toggle svg { display: block; }

.auth-aux { display: flex; justify-content: flex-end; margin: -6px 0 0; }
.auth-aux a { font-size: 13px; color: var(--au-muted); text-decoration: underline; text-underline-offset: 3px; }
.auth-aux a:hover { color: var(--au-ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.auth-btn {
  display: flex; align-items: center; justify-content: flex-start;
  height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 15px/1 var(--au-sans);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}
.auth-btn:active:not(:disabled) { transform: scale(0.99); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; }
.auth-btn:focus-visible { outline: none; }
.auth-btn.is-primary:focus-visible { background: #fff; }
.auth-btn.is-ghost:focus-visible { border-color: var(--au-hl); background: rgba(255, 255, 255, 0.05); }
.auth-btn.is-primary { width: 100%; background: linear-gradient(180deg, #fff 0%, #e9e1da 100%); color: #1f1f1f; }
.auth-btn.is-primary:hover:not(:disabled) { background: #fff; }
.auth-btn.is-ghost { background: transparent; border-color: var(--au-line); color: var(--au-ink); }
.auth-btn.is-ghost:hover:not(:disabled) { border-color: var(--au-hl); background: rgba(255, 255, 255, 0.04); }

.form-error {
  padding: 0; background: none; color: var(--au-danger);
  font-size: 13.5px; line-height: 1.45;
}

.auth-switch {
  margin: 20px 0 0; text-align: center; font-size: 13.5px; color: var(--au-muted);
}
.auth-switch a { color: var(--au-ink); text-decoration: underline; text-underline-offset: 3px; }
.auth-switch a:hover { color: var(--au-white); }

/* ── Login extras: account chooser + second factor ───────────────────────── */
.chooser { display: none; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--au-line); }
.chooser p { margin: 0 0 12px; font-size: 13.5px; color: var(--au-muted); line-height: 1.5; }
.chooser-btns { display: flex; gap: 10px; }
.chooser-btns .auth-btn { flex: 1; }

.twofa-title { margin: 0 0 6px; font-family: var(--au-head); font-weight: 600; font-size: 20px; color: var(--au-ink); }
.twofa-hint { margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--au-muted); }
.twofa-input {
  width: 100%; height: 56px; padding: 0 16px; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 24px; letter-spacing: 0.28em; text-indent: 0.28em;
  font-variant-numeric: tabular-nums;
  border-radius: 999px; border: 1px solid transparent;
  background: rgba(248, 242, 237, 0.07); color: var(--au-ink);
}
.twofa-input:focus { outline: none; border-color: var(--au-hl); background: rgba(248, 242, 237, 0.09); }

/* ── Signup extras: two steps + account-type cards ───────────────────────── */
.step-indicator { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.step-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--au-line-strong); transition: width .25s ease, background-color .25s ease; }
.step-dot.is-done { background: var(--au-white); }
.step-dot.is-active { width: 22px; background: var(--au-white); }
.step-label { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--au-muted); }
.signup-step { display: none; flex-direction: column; gap: 16px; }
.signup-step.is-active { display: flex; animation: auStepIn .25s ease both; }
@keyframes auStepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-nav { display: flex; gap: 10px; align-items: center; }
.step-nav .is-primary { flex: 1; }
.step-nav .is-ghost { flex: 0 0 auto; }

.type-list { display: grid; gap: 10px; }
.type-card {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  align-items: center; padding: 14px 16px; border-radius: 999px;
  background: rgba(248, 242, 237, 0.07);
  border: 1px solid transparent;
  color: var(--au-ink); font-family: var(--au-sans); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.type-card:hover:not([disabled]) { border-color: var(--au-hl); background: rgba(255, 255, 255, 0.04); }
.type-card.is-selected { border-color: var(--au-hl); background: rgba(255, 255, 255, 0.1); }
.type-card[disabled] { opacity: .5; cursor: not-allowed; }
.type-card .tc-body { flex: 1; }
.type-card .tc-name { display: block; font-family: var(--au-head); font-weight: 600; font-size: 16px; }
.type-card .tc-desc { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--au-muted); }
.type-card .tc-desc a { color: var(--au-ink); text-decoration: underline; text-underline-offset: 2px; }
.type-card .tc-soon {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--au-line); font: 600 11px/1.6 var(--au-sans); color: var(--au-muted);
}
.type-card .tc-radio {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--au-line-strong);
}
.type-card.is-selected .tc-radio { border-color: var(--au-white); box-shadow: inset 0 0 0 3px var(--au-bg), inset 0 0 0 9px var(--au-white); }

/* ── Motif panel ─────────────────────────────────────────────────────────
   The signature shape (rounded square, bottom-right notch, ball in the notch)
   filled with the homepage mesh: orange, mulberry and green. auth-art.js draws
   the SVG at the panel's size. */
.auth-art { position: relative; overflow: visible; isolation: isolate; }
.auth-art-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; }

.auth-art-card {
  position: absolute; z-index: 0; pointer-events: none;
  left: calc(var(--au-motif-x, 0px) + 32px); top: calc(var(--au-motif-y, 0px) + 32px);
  width: calc(var(--au-motif-w, 240px) - 56px);
  height: calc(var(--au-motif-ah, 200px) - 56px);
  display: flex; align-items: center; justify-content: flex-start;
}
.auth-art-text {
  font-family: 'Season Sans', 'Season Digits', 'Plus Jakarta Sans', sans-serif; font-weight: 600;
  line-height: 1.08; letter-spacing: -0.01em; color: #fff; text-align: left;
  opacity: 0; transition: opacity 1.2s ease-in-out;
}
.auth-art-text.is-in { opacity: 1; }
.auth-art-motif { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .auth-art-text { transition: none; }
  .signup-step.is-active { animation: none; }
}

/* ── Small screens: form only ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; padding: 0; }
  .auth-art { display: none; }
  .auth-pane { align-items: flex-start; padding: 48px 24px; }
}

/* ── Signup: email → password slide-up ───────────────────────────────────── */
.auth-form.is-stepped { gap: 0; }
.rv {
  display: grid; grid-template-rows: 1fr;
  opacity: 1; visibility: visible;
  transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1), opacity .3s ease, visibility 0s;
}
.rv > .rv-in { min-height: 0; overflow: hidden; padding: 12px 0 0; transition: padding .42s cubic-bezier(.22, 1, .36, 1); }
.rv.is-hidden > .rv-in { padding-top: 0; }
.rv.is-hidden { grid-template-rows: 0fr; opacity: 0; visibility: hidden; pointer-events: none; transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, visibility 0s .42s; }
/* Password rises into the Continue button's place … */
#rv-pw > .rv-in { transform: translateY(0); transition: transform .42s cubic-bezier(.22, 1, .36, 1), padding .42s cubic-bezier(.22, 1, .36, 1); }
#rv-pw.is-hidden > .rv-in { transform: translateY(18px); }
/* … and Create account fades in just after. */
#rv-create { transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1) .08s, opacity .35s ease .14s, visibility 0s; }
#rv-create.is-hidden { transition: grid-template-rows .3s ease, opacity .15s ease, visibility 0s .3s; }

/* ── Onboarding slides ───────────────────────────────────────────────────── */
.ob {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: flex-start;
  /* The motif panel's mesh (orange, mulberry, green on cream), full screen. */
  background:
    radial-gradient(70% 60% at 6% 8%, #EDB3CB 0%, rgba(237, 179, 203, 0) 100%),
    radial-gradient(75% 65% at 94% 14%, #EDB3CB 0%, rgba(237, 179, 203, 0) 100%),
    radial-gradient(80% 70% at 92% 94%, #8fd6b6 0%, rgba(143, 214, 182, 0) 100%),
    radial-gradient(80% 70% at 8% 96%, #f39a62 0%, rgba(243, 154, 98, 0) 100%),
    radial-gradient(55% 50% at 52% 58%, #f6b48a 0%, rgba(246, 180, 138, 0) 100%),
    #fff7ef;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s ease, visibility 0s .35s;
}
.ob.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .35s ease; }
body.ob-open { overflow: hidden; }
.ob-stage { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0 24px; }
.ob-logo { width: 52px; height: 52px; border-radius: 12px; margin-bottom: 28px; }
.ob-slide { display: none; flex-direction: column; align-items: center; width: 100%; }
.ob-slide.is-active { display: flex; animation: obIn .4s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes obIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ob-slide h2 {
  margin: 0 0 32px; text-align: center;
  font-family: var(--au-head); font-weight: 600; font-size: 30px; line-height: 1.2; letter-spacing: -0.01em; color: var(--au-ink);
}
.ob-form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 16px; }
.ob-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 620px; }
.ob-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 144px; height: 96px; padding: 0;
  border-radius: 16px; border: 1px solid var(--au-line);
  background: rgba(5, 5, 5, .55); color: var(--au-ink);
  font: 600 13.5px/1 var(--au-sans); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.ob-card svg { width: 22px; height: 22px; display: block; }
.ob-card:hover, .ob-card:focus-visible { outline: none; border-color: var(--au-hl); background: rgba(255, 255, 255, .05); }
.ob-card.is-selected { border-color: var(--au-hl); background: rgba(255, 255, 255, .07); }
.ob.is-busy .ob-card, .ob.is-busy .auth-btn { pointer-events: none; opacity: .6; }
.ob-slide .form-group input { background: rgba(248, 242, 237, .1); }
#ob-error { margin-top: 20px; max-width: 360px; text-align: center; }
.ob-dots { position: absolute; bottom: 36px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.ob-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .35); transition: width .3s ease, background-color .3s ease; }
.ob-dot.is-active { width: 22px; background: #fff; }
@media (max-width: 560px) {
  .ob-cards { width: 100%; }
  .ob-card { width: calc(50% - 6px); height: 96px; min-width: 0; }
  .ob-slide h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .rv.is-hidden, #rv-pw > .rv-in, #rv-create { transition: none; }
  .ob-slide.is-active { animation: none; }
}

/* Light theme for the slides: dark ink on the mesh. */
.ob { color: #1f1f1f; }
.ob-slide h2 { color: #1f1f1f; }
.ob .form-group input, .ob-slide .form-group input { background: rgba(255, 255, 255, .55); color: #1f1f1f; }
.ob .form-group input::placeholder { color: #6f625b; opacity: 1; }
.ob .form-group input:hover { background: rgba(255, 255, 255, .7); }
.ob .form-group input:focus { background: rgba(255, 255, 255, .8); border-color: var(--au-hl); }
.ob .auth-btn.is-primary { background: #1f1f1f; color: #fff; }
.ob .auth-btn.is-primary:hover:not(:disabled) { background: #000; }
.ob-card { background: transparent; border-color: rgba(31, 31, 31, .25); color: #1f1f1f; }
.ob-card:hover, .ob-card:focus-visible { border-color: #0a0a0a; background: transparent; }
.ob-card.is-selected { border-color: #0a0a0a; background: transparent; }
.ob-dot { background: rgba(31, 31, 31, .25); }
.ob-dot.is-active { background: #1f1f1f; }
#ob-error { background: none; color: #b3261e; }

/* Progress dots double as back-navigation: finished steps are buttons. */
.ob-dots { align-items: center; }
.ob-dot { padding: 0; border: 0; cursor: default; }
.ob-dot.is-past { cursor: pointer; background: rgba(31, 31, 31, .5); position: relative; }
.ob-dot.is-past::after { content: ''; position: absolute; inset: -8px; }
.ob-dot.is-past:hover, .ob-dot.is-past:focus-visible { outline: none; background: #1f1f1f; }

/* ── Confirm-your-email page: same mesh as the onboarding slides ─────────── */
body.auth-mesh {
  background:
    radial-gradient(70% 60% at 6% 8%, #EDB3CB 0%, rgba(237, 179, 203, 0) 100%),
    radial-gradient(75% 65% at 94% 14%, #EDB3CB 0%, rgba(237, 179, 203, 0) 100%),
    radial-gradient(80% 70% at 92% 94%, #8fd6b6 0%, rgba(143, 214, 182, 0) 100%),
    radial-gradient(80% 70% at 8% 96%, #f39a62 0%, rgba(243, 154, 98, 0) 100%),
    radial-gradient(55% 50% at 52% 58%, #f6b48a 0%, rgba(246, 180, 138, 0) 100%),
    #fff7ef;
  background-attachment: fixed;
  color: #1f1f1f;
}
.ce-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
.ce-wrap { width: 100%; max-width: 400px; }
#ce-loading { color: #6f625b; }
#ce-body { display: none; }
.ce-logo { display: block; width: 52px; height: 52px; margin: 0 auto 28px; border-radius: 12px; }
.ce-wrap h1 { margin: 0 0 12px; font-family: var(--au-head); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; color: #1f1f1f; }
.ce-sub { margin: 0 0 28px; font-size: 15px; line-height: 1.6; color: #4a3f39; }
.ce-email { font-weight: 600; color: #1f1f1f; }
.ce-switch { margin: 18px 0 0; font-size: 14px; color: #4a3f39; }
.ce-switch a { color: #1f1f1f; text-decoration: underline; text-underline-offset: 3px; }
.ce-switch a:hover { color: #000; }
.ce-wrap .form-error { color: #b3261e; margin-bottom: 16px; }
.ce-wrap .auth-btn.is-primary { background: #1f1f1f; color: #fff; }
.ce-wrap .auth-btn.is-primary:hover:not(:disabled) { background: #000; }
.ce-wrap .auth-btn.is-ghost { color: #1f1f1f; border-color: rgba(31, 31, 31, .3); }
.ce-wrap .auth-btn.is-ghost:hover:not(:disabled), .ce-wrap .auth-btn.is-ghost:focus-visible { border-color: #0a0a0a; background: transparent; }
.ce-wrap .form-group input { background: rgba(255, 255, 255, .55); color: #1f1f1f; }
.ce-wrap .form-group input::placeholder { color: #6f625b; opacity: 1; }
.ce-wrap .form-group input:hover { background: rgba(255, 255, 255, .7); }
.ce-wrap .form-group input:focus { background: rgba(255, 255, 255, .8); border-color: var(--au-hl); }
.ce-wrap .pw-toggle { color: #6f625b; }
.ce-wrap .pw-toggle:hover { color: #1f1f1f; background: rgba(31, 31, 31, .06); }
#ce-change { margin-top: 4px; }

/* The light-mesh screens keep the full-strength peach: half of it would vanish there. */
.ob, .ce-wrap { --au-hl: #f4c3a2; }

/* "Last used" hint on /login (public/js/last-login.js) */
.last-used-note { margin: -12px 0 16px; font-size: var(--small); color: var(--au-muted); }
.has-last-used { position: relative; }
.has-last-used input[name="email"] { padding-right: 96px; }
.is-last-used { position: relative; border-color: var(--au-orange); }
.last-used-badge {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 16px;
  background: var(--au-white); color: var(--au-bg); pointer-events: none;
}

/* Slide and confirm-email buttons: label centred. */
.ob .auth-btn, .ce-wrap .auth-btn { justify-content: center; text-align: center; }
