/* ============================================================
   Dream Job AI — design system
   ============================================================ */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #0b1220;
  --ink-2: #1f2937;
  --muted: #5b6472;
  --line: #e6e4dd;
  --line-strong: #cfcdc4;
  --accent: #1e2a5e;
  --accent-ink: #121b45;
  --accent-soft: #e8ebf5;
  --gold: #c9a34a;
  --gold-soft: #f7f0dc;
  --success: #1e9e6a;
  --success-soft: #e3f5ec;
  --danger: #c8102e;
  --danger-soft: #fdecee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 8px 24px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, 0.05), 0 20px 50px rgba(11, 18, 32, 0.12);
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(30px, 7vw, 40px); line-height: 1.12; font-weight: 700; }
h2 { font-size: clamp(24px, 6vw, 30px); line-height: 1.18; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
[hidden] { display: none !important; }

/* Background blobs */
.bg-blob {
  position: fixed; z-index: 0; pointer-events: none; filter: blur(70px); opacity: 0.55; border-radius: 50%;
}
.bg-blob-a { width: 520px; height: 520px; left: -200px; top: -180px; background: radial-gradient(circle at 30% 30%, #dbe4ff, transparent 70%); }
.bg-blob-b { width: 560px; height: 560px; right: -240px; bottom: -220px; background: radial-gradient(circle at 60% 60%, #f3e6c4, transparent 70%); }

/* Layout */
.header { position: sticky; top: 0; z-index: 20; background: rgba(246, 245, 241, 0.86); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 12px 16px; max-width: 560px; margin: 0 auto;
}
.topbar > .icon-btn { justify-self: start; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.top-actions [hidden] { display: none !important; }

/* App menu (bottom sheet on phones) */
.menu-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(12, 18, 40, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s var(--ease); }
.menu-overlay.open { background: rgba(12, 18, 40, .45); }
.menu-panel { width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(12,18,40,.18); transform: translateY(100%); transition: transform .22s var(--ease); max-height: 88vh; overflow-y: auto; }
.menu-overlay.open .menu-panel { transform: none; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; font-family: var(--font-display); font-size: 18px; }
.menu-head .icon-btn { width: 36px; height: 36px; box-shadow: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 13px 12px; border: 0; background: transparent; border-radius: 14px; color: var(--ink); font-size: 16px; line-height: 1.3; }
.menu-item .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--bg, #f6f5f1); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.menu-item:active { background: #eef0f7; }
.menu-item.current { background: #eef1fb; box-shadow: inset 3px 0 0 var(--accent); }
.menu-item.danger b { color: var(--danger, #c8102e); }
.menu-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.brand { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); transition: transform .15s var(--ease), background .15s;
}
.icon-btn:active { transform: scale(0.94); }
.topbar .icon-btn[hidden] { display: inline-flex; visibility: hidden; pointer-events: none; } /* keep the grid column so the brand stays centered */
.lang-toggle {
  justify-self: end; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); display: inline-flex; gap: 4px; align-items: center;
}
.lang-toggle .sep { opacity: .4; }
.lang-toggle [data-lang].active { color: var(--ink); }

.progress { max-width: 560px; margin: 0 auto; padding: 2px 20px 10px; }
.progress-track { display: flex; gap: 8px; }
.progress-seg { flex: 1; height: 6px; border-radius: 999px; background: #e3e1da; overflow: hidden; }
.progress-seg i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #4a5aa0); border-radius: 999px; transition: width .45s var(--ease); }
.progress-seg.done i { width: 100%; background: var(--success); }
.progress-label { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; letter-spacing: 0.02em; text-transform: uppercase; }

.app {
  position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: 20px 20px calc(120px + var(--safe-bottom)); min-height: 60dvh;
}
.screen { animation: slide-in .42s var(--ease) both; }
.screen.back { animation-name: slide-in-back; }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: fade-up .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }
.stagger > *:nth-child(7) { animation-delay: .36s; }
.stagger > *:nth-child(8) { animation-delay: .42s; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #c8102e; margin-bottom: 10px; }
.question { margin-bottom: 22px; }
.question p { margin-top: 10px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 22px; border-radius: 16px; border: 1px solid transparent;
  font-weight: 600; font-size: 17px; text-decoration: none; transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(30, 42, 94, 0.28); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-link { background: transparent; color: var(--accent); height: auto; padding: 8px 4px; }
.btn-block { width: 100%; }
.btn-sm { height: 42px; padding: 0 16px; font-size: 15px; border-radius: 12px; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 20px calc(16px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(246, 245, 241, 0));
}
.sticky-cta > * { max-width: 520px; margin: 0 auto; }

/* Option cards */
.options { display: grid; gap: 12px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; width: 100%; text-align: left; min-height: 60px; padding: 16px 18px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; font-weight: 500; transition: border-color .2s, transform .15s var(--ease), background .2s;
}
.opt:hover { border-color: var(--line-strong); }
.opt.locked { opacity: .8; background: var(--surface-2); }
.opt:active { transform: scale(0.985); }
.opt .emoji { font-size: 22px; width: 30px; text-align: center; flex: 0 0 auto; }
.opt .box {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-strong); flex: 0 0 auto; display: grid; place-items: center; margin-left: auto;
  transition: background .2s, border-color .2s;
}
.opt .box::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translateY(-1px); opacity: 0; }
.opt.selected { border-color: var(--accent); background: #f5f7ff; }
.opt.selected .box { background: var(--accent); border-color: var(--accent); }
.opt.selected .box::after { opacity: 1; }
.opt.pop { animation: pop .3s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
.options.two .opt { justify-content: center; text-align: center; }
.options.two .opt .box { display: none; }

/* Inputs */
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, textarea.input {
  width: 100%; min-height: 56px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s; font-size: 17px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500;
  transition: all .15s;
}
.chip.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.locked { color: var(--muted); background: var(--surface-2); }
.template-switch { flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card.accent { background: linear-gradient(135deg, #0b1220, #1a2a5e); color: #fff; border: none; }
.card.accent .muted { color: rgba(255, 255, 255, 0.72); }
.card.gold { border-color: #eadfbf; background: linear-gradient(180deg, #fffdf7, #fbf5e6); }
.card.success { border-color: #bfe6d3; background: var(--success-soft); }
.stat { font-family: var(--font-display); font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.pill.gold { background: var(--gold-soft); color: #8a6d2f; }
.pill.success { background: var(--success-soft); color: #166b48; }

.hero-visual { margin: 22px 0 6px; }
.hero-visual svg { width: 100%; height: auto; }

.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: 0 0 auto; font-size: 20px; }
.feature + .feature { margin-top: 16px; }

.quote { border-left: 4px solid var(--accent); padding: 14px 18px; background: var(--surface); border-radius: 0 16px 16px 0; font-size: 20px; font-family: var(--font-display); font-weight: 600; line-height: 1.35; }

/* Analysis */
.ring { position: relative; width: 168px; height: 168px; margin: 8px auto 20px; }
.ring svg { transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 40px; letter-spacing: -0.03em; }
.steps { display: grid; gap: 12px; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 500; transition: color .3s; }
.step .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: 0 0 auto; transition: all .3s; }
.step.active { color: var(--ink); }
.step.active .dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--success); border-color: var(--success); }
.step.done .dot::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Diagnosis */
.diag { display: grid; gap: 10px; }
.diag-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.diag-item .lvl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; flex: 0 0 auto; }
.lvl.high { background: var(--danger-soft); color: var(--danger); }
.lvl.mid { background: var(--gold-soft); color: #8a6d2f; }
.lvl.low { background: var(--success-soft); color: #166b48; }

/* Upload */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center; background: var(--surface); transition: all .2s; cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: #f5f7ff; }
.dropzone .big { font-size: 40px; }

/* Resume viewer */
.template-switch { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.resume-frame {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line);
}
.resume-scale { transform-origin: top left; }
.resume-actions { display: grid; gap: 10px; margin-top: 14px; }
.resume-actions .btn { white-space: normal; }
.notes li { margin-bottom: 8px; }

/* Interview */
.qcard { background: var(--ink); color: #fff; border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); }
.qcard .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, 0.7); margin-bottom: 12px; }
.qcard .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #fff3c4); display: grid; place-items: center; color: var(--ink); font-weight: 700; font-size: 13px; }
.qcard .q { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.35; }
.qcard .tr { margin-top: 12px; color: rgba(255, 255, 255, 0.7); font-size: 15px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 12px; }
.qcard .tip { margin-top: 12px; font-size: 14px; color: #ffe9a8; }
.score { display: flex; align-items: center; gap: 14px; }
.score .num { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.score .bar { flex: 1; height: 10px; border-radius: 999px; background: #e3e1da; overflow: hidden; }
.score .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--success)); border-radius: 999px; transition: width .8s var(--ease); }
.phrase { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.phrase b { font-size: 16px; }
.phrase span { font-size: 14px; color: var(--muted); }
.phrases { display: grid; gap: 8px; }
.model-answer { font-size: 17px; line-height: 1.6; padding: 16px 18px; border-radius: 14px; background: #f5f7ff; border: 1px solid #dfe6ff; }
.fix { padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); font-size: 15px; }
.fix s { color: var(--danger); opacity: .8; }
.fix b { color: #166b48; }

/* Pricing */
.plan { position: relative; }
.plan.featured { border: 2px solid var(--accent); box-shadow: 0 16px 40px rgba(31, 75, 255, 0.18); }
.plan .badge { position: absolute; top: -13px; left: 20px; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: inline-flex; align-items: center; }
.plan .founder { font-size: 13px; color: var(--muted); margin-top: 6px; }
.plan .price { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 700; flex: 0 0 auto; }
.plan li.off { color: var(--muted); }
.plan li.off::before { content: "–"; color: var(--line-strong); }
.lock { display: inline-flex; align-items: center; gap: 8px; }

/* Cheat sheet */
.sheet { background: #fff; border-radius: 16px; padding: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.sheet h3 { margin-bottom: 8px; }
.sheet ol, .sheet ul { margin: 0; padding-left: 20px; }
.sheet li { margin-bottom: 8px; }
.sheet .ans { color: var(--muted); font-size: 15px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; animation: fade-up .3s var(--ease); }

/* Loading */
.loader { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(90deg, #ecebe6 25%, #f6f5f1 50%, #ecebe6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Print (resume) */
@media print {
  body { background: #fff; }
  .topbar, .progress, .sticky-cta, .bg-blob, .toast, .no-print { display: none !important; }
  .app { padding: 0; max-width: none; }
  .resume-frame { box-shadow: none; border: none; border-radius: 0; }
  .resume-scale { transform: none !important; width: auto !important; }
  @page { margin: 0.5in; size: letter; }
}
@media (min-width: 640px) {
  body { font-size: 17px; }
  .app { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Voice */
.voice-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice-bar .btn { white-space: normal; height: auto; min-height: 48px; padding: 10px 12px; }
.btn.recording { background: var(--danger); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
[data-speaking] { box-shadow: 0 0 0 4px var(--accent-soft); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(211, 63, 73, .45); } 50% { box-shadow: 0 0 0 10px rgba(211, 63, 73, 0); } }
