/* ============================================================
   JIFFYSCORE AI — NEW PUBLIC + ACCOUNT PAGES
   ------------------------------------------------------------
   Page-level additions that sit ON TOP of the shared design
   system (jiffy-tokens.css + jiffy-components.css). Nothing
   here redefines a design-system token — it only composes new
   layout patterns (hero backdrop, auth split, profile shell,
   FAQ, toggles) out of the existing tokens.

   Load order per page:
     1. jiffy-tokens.css
     2. jiffy-components.css
     3. jiffy-pages.css   (this file)
   ============================================================ */

/* ---- Shared brand mark (real JiffyScore app-icon logo) ---- */
.js-mark { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-dot.js-tile { background: var(--bg-2); }

/* Keep nav CTA on one line */
.nav-cta { white-space: nowrap; }

/* ---- Generic page footer ---------------------------------- */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.site-footer .foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); margin: 0 0 16px;
}
.site-footer .foot-link { display: block; color: var(--ink-soft); font-size: 14px; padding: 6px 0; transition: color .25s; }
.site-footer .foot-link:hover { color: var(--gold); }
.site-footer .foot-base {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--mute);
}

/* ============================================================
   LANDING — animated hero backdrop
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 168px 32px 96px;
  max-width: 1440px;
  margin: 0 auto;
}
.hero-bg { position: absolute; inset: -10% -10% 0 -10%; z-index: 0; pointer-events: none; }
.hero-bg .glow {
  position: absolute; border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.hero-bg .glow-gold {
  width: 620px; height: 620px; top: -180px; right: -120px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 68%);
  animation: drift-a 22s var(--ease-out-quart) infinite alternate;
}
.hero-bg .glow-lime {
  width: 560px; height: 560px; bottom: -220px; left: -100px;
  background: radial-gradient(circle, rgba(141,230,90,0.18) 0%, transparent 68%);
  animation: drift-b 26s var(--ease-out-quart) infinite alternate;
}
.hero-bg .grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 75%);
  opacity: 0.6;
}
@keyframes drift-a { from { transform: translate(0,0) scale(1); } to { transform: translate(-40px,30px) scale(1.08); } }
@keyframes drift-b { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,-24px) scale(1.12); } }
html[data-motion="off"] .hero-bg .glow { animation: none; }

.hero-inner { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }

/* ---- Animated AI "answer" typing chip in hero copy -------- */
.answer-card {
  background: linear-gradient(165deg, var(--cream) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-2);
}
.answer-card .ac-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.answer-card .ac-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.answer-card .ac-engine { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--mute); text-transform: uppercase; }
.answer-card .ac-body { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.answer-card .ac-cite {
  color: var(--gold); font-weight: 600;
  border-bottom: 1px dashed var(--line);
}
.answer-card .ac-caret {
  display: inline-block; width: 8px; height: 16px; vertical-align: -2px;
  background: var(--gold); margin-left: 2px; border-radius: 1px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
html[data-motion="off"] .answer-card .ac-caret { animation: none; }

/* ---- Hero video / product slot --------------------------- */
.video-slot {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 30% 20%, rgba(232,181,60,0.14), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(141,230,90,0.12), transparent 55%),
    linear-gradient(160deg, var(--cream) 0%, var(--off) 100%);
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  box-shadow: var(--shadow-3);
}
.video-slot .play {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--lime-gradient); color: var(--on-lime);
  display: grid; place-items: center;
  box-shadow: var(--glow-lime);
  transition: transform .3s var(--ease-spring), filter .3s;
}
.video-slot:hover .play { transform: scale(1.06); filter: brightness(1.08); }
.video-slot .slot-tag {
  position: absolute; left: 16px; bottom: 16px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-soft); background: color-mix(in oklch, var(--off) 60%, transparent);
  backdrop-filter: blur(12px); border: 1px solid var(--line-soft);
  border-radius: var(--r-pill); padding: 6px 12px;
}
.video-slot .slot-note {
  position: absolute; right: 16px; top: 16px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
  border: 1px dashed var(--line); border-radius: var(--r-pill); padding: 5px 10px;
}

/* ---- Steps (how it works) -------------------------------- */
.step-card { position: relative; }
.step-card .step-no {
  font-family: var(--font-display); font-weight: 700; font-size: 56px;
  line-height: 1; color: var(--gold); opacity: 0.9;
}
.step-card .step-ico { color: var(--lime); margin-bottom: 6px; }
.step-card h3 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 14px 0 8px; color: var(--ink); letter-spacing: -0.01em; }
.step-card p { color: var(--ink-soft); line-height: 1.6; margin: 0; font-size: 15px; }
.step-flow { position: relative; }

/* ---- Stat / outcomes band -------------------------------- */
.stat-band { background: linear-gradient(165deg, var(--cream) 0%, var(--bg-2) 100%); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stat-cell .stat-val { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4vw, 60px); line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.stat-cell .stat-val .unit { color: var(--gold); }
.stat-cell .stat-lbl { font-size: 14px; color: var(--ink-soft); margin-top: 12px; max-width: 22ch; line-height: 1.45; }

/* ---- Integrations grid ----------------------------------- */
.integration {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  transition: transform .4s var(--ease-out-expo), border-color .3s, box-shadow .4s;
}
.integration:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow-2); }
.integration .ig-logo {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  display: grid; place-items: center; color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.integration .ig-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.integration .ig-desc { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---- FAQ (also SEO/GEO content) -------------------------- */
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--ink); letter-spacing: -0.01em;
  transition: color .25s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--gold); }
.faq-item .faq-plus { flex: none; width: 22px; height: 22px; position: relative; transition: transform .35s var(--ease-out-expo); color: var(--gold); }
.faq-item[open] .faq-plus { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 4px 28px; max-width: 80ch; }
.faq-item .faq-body p { color: var(--ink-soft); line-height: 1.7; margin: 0 0 12px; font-size: 16px; }

/* ---- Final CTA band -------------------------------------- */
.cta-band {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--cream) 0%, var(--white) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 72px 56px;
  text-align: center;
  box-shadow: var(--glow-gold);
}
.cta-band .cta-glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(141,230,90,0.16), transparent 70%); top: -160px; left: 50%; transform: translateX(-50%); filter: blur(40px); pointer-events: none; }

/* ============================================================
   AUTH — split layout for signup / forgot-password
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; }
.auth-aside {
  position: relative; overflow: hidden;
  padding: 56px 56px 48px;
  background: linear-gradient(165deg, var(--cream) 0%, var(--off) 100%);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside .aside-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 80% at 30% 20%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 20%, #000, transparent 70%);
  opacity: 0.5;
}
.auth-aside .aside-glow { position: absolute; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, var(--gold-glow), transparent 70%); top: -140px; right: -120px; filter: blur(50px); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-quote-card {
  background: linear-gradient(165deg, var(--white) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px; box-shadow: var(--shadow-2);
}
.invite-request-panel {
  display: grid;
  gap: 16px;
  margin: 28px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 0% 0%, var(--gold-soft), transparent 52%),
    linear-gradient(165deg, color-mix(in oklch, var(--white) 78%, transparent), color-mix(in oklch, var(--bg-2) 88%, transparent));
  box-shadow: var(--shadow-2);
}
.invite-request-panel .irp-head h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.invite-request-panel .irp-head p,
.invite-request-panel .irp-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.invite-request-panel .irp-head a { color: var(--gold); font-weight: 700; }
.irp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.irp-field { display: grid; gap: 7px; min-width: 0; }
.irp-field--full { grid-column: 1 / -1; }
.irp-field > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.irp-field .input,
.irp-field .select {
  min-height: 44px;
  font-size: 13px;
  background: color-mix(in oklch, var(--off) 84%, black 10%);
}
.irp-field textarea.input {
  min-height: 108px;
  resize: vertical;
  line-height: 1.45;
}
.irp-note {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--gold-soft) 42%, transparent);
}
.irp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.irp-actions .btn { min-height: 44px; padding: 0 16px; font-size: 13px; }

.auth-main { display: flex; align-items: flex-start; justify-content: center; padding: 56px 40px 80px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 520px; }
.auth-card .auth-head { margin-bottom: 28px; }

.aside-points { display: grid; gap: 18px; margin-top: 8px; }
.aside-point { display: flex; gap: 14px; align-items: flex-start; }
.aside-point .ap-ico { color: var(--lime); flex: none; margin-top: 2px; }
.aside-point .ap-t { font-weight: 600; color: var(--ink); font-size: 15px; }
.aside-point .ap-d { color: var(--ink-soft); font-size: 13px; margin-top: 2px; line-height: 1.5; }

/* ---- Compact field variant for dense forms --------------- */
.field--tight { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .pw-toggle {
  position: absolute; right: 12px;
  background: transparent; border: 0; color: var(--mute);
  padding: 6px; display: grid; place-items: center; border-radius: var(--r-sm);
}
.input-wrap .pw-toggle:hover { color: var(--gold); }

/* ---- Password strength ----------------------------------- */
.pw-meter { display: flex; gap: 6px; margin-top: 10px; }
.pw-meter .seg { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--surface-2); transition: background .3s; }
.pw-meter[data-score="1"] .seg:nth-child(1) { background: var(--coral); }
.pw-meter[data-score="2"] .seg:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-score="3"] .seg:nth-child(-n+3) { background: var(--lime-2); }
.pw-meter[data-score="4"] .seg { background: var(--lime); }
.pw-hint { font-size: 12px; color: var(--mute); margin-top: 6px; }

/* ---- Role / plan selector -------------------------------- */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }

/* ---- Checkbox row ---------------------------------------- */
.check-row { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.check-row input { width: 18px; height: 18px; accent-color: var(--lime); margin-top: 1px; flex: none; }
.check-row a { color: var(--gold); }

/* ---- Inline status / alert ------------------------------- */
.alert { display: none; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.alert.is-show { display: flex; }
.alert--err { background: var(--coral-soft); color: var(--coral); border: 1px solid rgba(240,138,106,0.2); }
.alert--ok { background: var(--emerald-soft); color: var(--emerald); border: 1px solid rgba(123,220,140,0.2); }
.alert--info { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--line-soft); }

/* ============================================================
   PROFILE — account shell
   ============================================================ */
.app-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: color-mix(in oklch, var(--off) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.app-bar .ab-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid var(--line-soft); border-radius: var(--r-pill); }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 14px; overflow: hidden; }
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .uc-name { font-size: 13px; color: var(--ink); font-weight: 600; }
.user-chip .uc-role { font-family: var(--font-mono); font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

.profile-shell { display: grid; grid-template-columns: 248px 1fr; gap: 40px; max-width: 1180px; margin: 0 auto; padding: 48px 32px 96px; }
.profile-nav { position: sticky; top: 92px; align-self: start; display: grid; gap: 4px; }
.pn-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-md);
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; transition: background .25s, color .25s, border-color .25s;
}
.pn-link:hover { background: var(--surface-2); color: var(--ink); }
.pn-link.is-active { background: var(--gold-soft); color: var(--gold); border-color: var(--line-soft); }
.pn-link svg { flex: none; }

.profile-content { display: grid; gap: 28px; min-width: 0; }
.psec { scroll-margin-top: 96px; }
.psec-head { margin-bottom: 20px; }
.psec-head h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; color: var(--ink); }
.psec-head p { color: var(--ink-soft); font-size: 14px; margin: 0; }
.psec-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

/* ---- Avatar / logo uploader ------------------------------ */
.uploader { display: flex; align-items: center; gap: 20px; }
.uploader .up-preview {
  width: 88px; height: 88px; border-radius: var(--r-lg); flex: none;
  background: var(--bg-2); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
}
.uploader .up-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Toggle switch --------------------------------------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-t { font-weight: 600; font-size: 15px; color: var(--ink); }
.switch-row .sr-d { font-size: 13px; color: var(--ink-soft); margin-top: 2px; max-width: 52ch; line-height: 1.5; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-pill); transition: background .3s, border-color .3s; }
.switch .track::before { content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--mute); transition: transform .3s var(--ease-spring), background .3s; }
.switch input:checked + .track { background: var(--lime-gradient); border-color: transparent; }
.switch input:checked + .track::before { transform: translate(20px, -50%); background: var(--on-lime); }

/* ---- API key row ----------------------------------------- */
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--bg-2); }
.key-row .k-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.key-row .k-val { font-family: var(--font-mono); font-size: 12px; color: var(--mute); margin-top: 3px; }
.key-row .k-meta { font-family: var(--font-mono); font-size: 11px; color: var(--mute); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .signup-page .auth-aside {
    display: flex;
    min-height: auto;
    padding: 28px 20px 0;
    background: var(--off);
    border-right: 0;
  }
  .signup-page .auth-aside > .brand,
  .signup-page .auth-aside > div:not(.invite-request-panel),
  .signup-page .auth-aside .auth-quote-card,
  .signup-page .auth-aside .aside-bg,
  .signup-page .auth-aside .aside-glow {
    display: none;
  }
  .signup-page .invite-request-panel {
    margin: 0 auto;
    width: min(100%, 560px);
  }
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .profile-shell { grid-template-columns: 1fr; gap: 24px; }
  .profile-nav { position: static; grid-auto-flow: column; overflow-x: auto; padding-bottom: 6px; }
  .pn-link { white-space: nowrap; }
}
@media (max-width: 640px) {
  .field-row, .role-grid, .irp-grid { grid-template-columns: 1fr; }
  .site-footer .foot-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 128px; }
  .cta-band { padding: 48px 24px; }
  .auth-main { padding: 32px 20px 64px; }
  .nav-links { display: none; }
}
