/* ============================================================
   ResumeMaker — app design system
   Light surfaces, dark text, one indigo accent for interaction,
   generous whitespace, soft layered shadows, crisp typography.
   ============================================================ */
:root {
  /* Brand (indigo) */
  --brand: #4f46e5;
  --brand-700: #4338ca;
  --brand-100: #e0e7ff;
  --brand-50: #eef2ff;

  /* Neutrals (slate) */
  --ink: #0f172a;
  --body: #3f4a5c;
  --muted: #6b7688;
  --line: #e8eaf1;
  --line-strong: #d7dbe6;
  --bg: #f5f6fb;
  --card: #ffffff;

  /* Semantic */
  --ok-bg: #ecfdf5; --ok-fg: #047857; --ok-line: #a7f3d0;
  --err-bg: #fef2f2; --err-fg: #b91c1c; --err-line: #fecaca;
  --danger: #dc2626;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 3px rgba(15,23,42,.05), 0 8px 20px -12px rgba(15,23,42,.16);
  --shadow-lg: 0 18px 44px -14px rgba(15,23,42,.22);
  --shadow-brand: 0 10px 22px -8px rgba(79,70,229,.5);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--font); font-size: 15.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3 { color: var(--ink); line-height: 1.18; letter-spacing: -.02em; }
h1 { font-size: 30px; margin: 0 0 6px; font-weight: 800; }
h2 { font-size: 27px; font-weight: 800; margin: 0 0 8px; }
h3 { font-size: 16.5px; margin: 0 0 4px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 34px 24px 64px; flex: 1 0 auto; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 24px; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--brand), #818cf8); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; box-shadow: var(--shadow-sm);
}
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a { color: var(--body); font-weight: 500; font-size: 14.5px; }
.topbar nav a:hover { color: var(--ink); }
.user-email { color: var(--muted); font-size: 13.5px; }

/* ---- Footer ---- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--card); }
.site-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .brand { font-size: 14px; }
.site-footer .brand-mark { width: 22px; height: 22px; font-size: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  padding: 10px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; line-height: 1.1; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--brand-700); color: #fff; text-decoration: none; box-shadow: var(--shadow-brand); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); box-shadow: none; transform: translateY(-1px); }
.btn-invert { background: #fff; color: var(--brand); box-shadow: none; }
.btn-invert:hover { background: #f4f5ff; color: var(--brand-700); box-shadow: 0 10px 22px -8px rgba(0,0,0,.35); }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13.5px; padding: 4px 2px; font-weight: 500; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.inline { display: inline; }

/* ---- Flash ---- */
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: 14px; font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.flash-err { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-line); }

/* ---- Forms ---- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 16px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; margin-top: 6px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #9aa3b2; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { resize: vertical; }
label small { font-weight: 400; }

/* ---- Auth ---- */
.auth-card { max-width: 420px; margin: 52px auto; background: var(--card); padding: 36px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-card h1 { font-size: 25px; }
.auth-card .muted { margin-bottom: 6px; }
.auth-card .btn { margin-top: 22px; }
.auth-card .center { margin-top: 18px; }

/* ============================================================
   Landing page
   ============================================================ */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 44px 0 60px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: 50px; line-height: 1.05; letter-spacing: -.03em; margin: 0 0 18px; }
.hero .grad { background: linear-gradient(120deg, var(--brand), #7c8cf8 60%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 17.5px; color: var(--body); max-width: 42ch; margin: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.hero-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; color: var(--muted); font-size: 14px; }
.hero-trust li { display: flex; align-items: center; gap: 7px; }
.hero-trust li::before { content: "✓"; color: #10b981; font-weight: 800; }

/* Hero mock document with a glow */
.hero-art { display: flex; justify-content: center; position: relative; }
.hero-art::before { content: ""; position: absolute; width: 340px; height: 340px; background: radial-gradient(circle, rgba(124,140,248,.35), transparent 62%); filter: blur(10px); z-index: 0; }
.mock-doc { position: relative; z-index: 1; width: 330px; height: 430px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; display: flex; transform: rotate(1.5deg); }
.mock-side { width: 34%; background: linear-gradient(180deg, #1f2937, #111827); flex: none; }
.mock-main { flex: 1; padding: 26px 22px; }
.mock-name { height: 17px; width: 62%; background: #0f172a; border-radius: 5px; margin-bottom: 9px; }
.mock-rule { height: 3px; width: 42px; background: var(--brand); border-radius: 3px; margin: 18px 0 12px; }
.mock-line { height: 9px; background: #e6e9f0; border-radius: 5px; margin: 8px 0; }
.mock-line.w90 { width: 90%; } .mock-line.w85 { width: 85%; } .mock-line.w80 { width: 80%; }
.mock-line.w70 { width: 70%; } .mock-line.w60 { width: 60%; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 16px 0 8px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); border: 1px solid var(--brand-100); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.feature h3 { font-size: 16px; }
.feature p { margin: 0; font-size: 14.5px; }

/* Templates strip */
.templates-strip { padding: 56px 0 8px; text-align: center; }
.templates-strip h2, .steps h2 { font-size: 28px; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin: 0; }
.steps-cta { text-align: center; margin-top: 28px; }
.template-name { font-weight: 700; color: var(--ink); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, 344px); justify-content: center; gap: 24px; margin-top: 26px; }
.tpl-card { display: block; width: 344px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.tpl-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tpl-frame { position: relative; width: 344px; height: 300px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.tpl-frame::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -40px 40px -30px rgba(255,255,255,.92); pointer-events: none; }
.tpl-frame iframe { position: absolute; top: 0; left: 0; width: 820px; height: 1080px; border: 0; transform: scale(.42); transform-origin: top left; pointer-events: none; }
.tpl-meta { padding: 13px 15px; display: flex; flex-direction: column; gap: 3px; text-align: left; }

/* Steps */
.steps { padding: 60px 0 20px; text-align: center; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; margin-top: 26px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.step h3 { font-size: 16px; }
.step p { margin: 0; font-size: 14.5px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #818cf8); color: #fff; font-weight: 700; margin-bottom: 12px; box-shadow: var(--shadow-brand); }

/* CTA band */
.cta-band { margin: 56px 0 8px; padding: 48px 32px; text-align: center; border-radius: var(--r-xl); color: #fff; background: linear-gradient(135deg, #4f46e5, #6366f1 55%, #0ea5e9); box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; font-size: 28px; }
.cta-band p { color: rgba(255,255,255,.9); margin: 4px 0 22px; }

/* ============================================================
   Dashboard
   ============================================================ */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, 300px); justify-content: center; gap: 22px; }
.resume-card { width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.resume-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.resume-thumb { display: block; position: relative; width: 300px; height: 208px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.resume-thumb iframe { position: absolute; top: 0; left: 0; width: 820px; height: 1120px; border: 0; transform: scale(.366); transform-origin: top left; pointer-events: none; }
.resume-thumb::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -34px 26px -22px rgba(255,255,255,.92); pointer-events: none; }
.resume-card-body { padding: 15px 16px 12px; }
.resume-card-body h3 { font-size: 16px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-card-body > .muted { margin: 0 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.resume-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.resume-card-actions { display: flex; gap: 7px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); background: #fcfcfe; }
.card-tools { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); border-radius: 8px; cursor: pointer;
  transition: color .12s, background .12s, border-color .12s, transform .12s;
}
.icon-btn:hover { color: var(--ink); background: #f4f5fb; border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.chip { display: inline-block; background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); border-radius: 999px; padding: 2px 11px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty .btn { margin-top: 14px; }

/* ============================================================
   Editor
   ============================================================ */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.editor-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.editor-toolbar.bottom { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.title-input { flex: 1 1 200px; width: auto; margin-top: 0; font-weight: 700; font-size: 16px; }
.editor-toolbar select { width: auto; margin-top: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 16px 0 0; }
legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid-2.tight { gap: 8px; }
.row { border: 1px solid var(--line); background: #fbfbfe; border-radius: var(--r); padding: 14px; margin-bottom: 12px; position: relative; }
.row-inline { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.row [data-remove] { margin-top: 6px; }

/* Profile photo control */
.photo-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.box-head { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.photo-row { display: flex; gap: 16px; align-items: center; }
.photo-thumb { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); flex: none; box-shadow: var(--shadow-sm); }
.photo-controls { min-width: 0; }
.photo-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.photo-upload input[type=file] { width: auto; margin-top: 0; font-size: 13px; }
.photo-controls .inline { display: inline-block; margin-top: 6px; }

.preview-pane { position: sticky; top: 82px; }
.preview-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); background: #e9ebf1; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; background: #fff; border-bottom: 1px solid var(--line); }
.preview-title { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.preview-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.pill-soft { background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.preview-frame { display: block; width: 100%; height: 80vh; border: 0; background: #e9ebf1; }

/* PDF.js preview: each page as a paper sheet on a soft grey desk. */
.pdf-viewer { height: 80vh; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; background: #e9ebf1; padding: 18px 16px; }
.pdf-page { width: max-content; margin: 0 auto 18px; background: #fff; border: 1px solid #cdd2de; border-radius: 3px; box-shadow: 0 2px 4px rgba(15,23,42,.10), 0 8px 22px -8px rgba(15,23,42,.20); overflow: hidden; }
.pdf-page:last-child { margin-bottom: 0; }
.pdf-page canvas { display: block; }
.pdf-loading, .pdf-error { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .preview-frame { height: 70vh; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 38px; }
  .features, .step-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .features, .step-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .topbar { padding: 12px 16px; }
  .container { padding: 24px 16px 48px; }
}

/* ---- Billing: pricing, subscribe & status ---- */
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.pricing { padding: 60px 0 20px; text-align: center; }
.pricing h2 { font-size: 28px; margin-bottom: 6px; }
.subscribe { max-width: 640px; margin: 40px auto 20px; text-align: center; }
.subscribe h1 { font-size: 34px; }
.plan-card {
  max-width: 420px; margin: 26px auto 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 32px; text-align: center;
}
.plan-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.plan-amount { font-size: 44px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.plan-per { color: var(--muted); font-weight: 600; }
.plan-feats { list-style: none; padding: 0; margin: 22px 0 24px; text-align: left; display: grid; gap: 10px; }
.plan-feats li { display: flex; align-items: center; gap: 9px; color: var(--body); }
.plan-feats li::before { content: "✓"; color: #10b981; font-weight: 800; }
.plan-card .btn { width: 100%; }
.plan-card .small { margin-top: 12px; }
.billing-status { max-width: 560px; margin: 64px auto; text-align: center; }
.billing-status h1 { font-size: 30px; margin-bottom: 10px; }
.billing-status .btn { margin-top: 24px; }

/* ---- Contact ---- */
.contact { text-align: center; padding: 48px 0 8px; }
.contact h2 { font-size: 26px; margin-bottom: 6px; }
.contact a { font-weight: 700; }
