/* ── LocalResume — private, in-browser resume builder ──────────────── */
:root {
  --brand: #047857;
  --brand-dark: #065f46;
  --brand-light: #34d399;
  --brand-soft: #ecfdf5;
  --brand-border: #a7f3d0;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --line: #e7e8ee;
  --bg: #f7f7fb;
  --card: #ffffff;
  --ok: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 1px 3px rgba(20,20,40,.06), 0 8px 24px rgba(20,20,40,.05);
  --shadow-lg: 0 20px 60px rgba(20,20,40,.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(28px, env(safe-area-inset-right)) 14px max(28px, env(safe-area-inset-left));
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo svg { width: 30px; height: 30px; }
.logo b { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.privacy-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ok);
  background: #f0fdf9; border: 1px solid #99f6e4;
  padding: 5px 12px; border-radius: 999px;
  margin-right: -10px;
}
.privacy-pill svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .privacy-pill { font-size: 10.5px; padding: 4px 9px; gap: 5px; margin-right: -16px; }
  .privacy-pill svg { width: 12px; height: 12px; }
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 40px 24px 20px; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; max-width: 680px; margin: 0 auto 10px; }
.hero .accent { color: var(--brand); }
.hero p { color: var(--muted); font-size: 15.5px; max-width: 520px; margin: 0 auto; }

.btn {
  border: none; border-radius: 12px; padding: 11px 20px; font-weight: 700; font-size: 14.5px;
  background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(4,120,87,.22);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(4,120,87,.28); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand-border); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

footer { text-align: center; color: #9ca3bf; font-size: 12.5px; padding: 30px 24px max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: 30px; }
footer a { color: var(--muted); }

/* ── Editor ────────────────────────────────────────────────────────── */
.editor { max-width: 1120px; margin: 0 auto; padding: 10px 24px 24px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: flex-start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; display: block; }
.field { margin-bottom: 14px; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px;
  background: #fbfbfd; transition: border-color .12s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-light); background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field textarea { resize: vertical; min-height: 60px; }
.panel h3 { font-size: 14.5px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ── Template picker ───────────────────────────────────────────────── */
.template-picker { display: flex; gap: 10px; margin-bottom: 16px; }
.template-opt {
  flex: 1; border: 2px solid var(--line); border-radius: 12px; padding: 12px; text-align: center;
  background: var(--card); font-weight: 700; font-size: 13px; color: var(--muted);
}
.template-opt.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

/* ── Repeatable entry blocks (experience / education) ─────────────── */
.entry-block { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; position: relative; }
.entry-block .entry-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.entry-block .entry-label { font-size: 12px; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .3px; }
.entry-block .rm-entry { background: none; border: none; color: var(--muted); display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 6px; border-radius: 6px; }
.entry-block .rm-entry:hover { background: #fee2e2; color: var(--danger); }
.entry-block .rm-entry svg { width: 14px; height: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.checkbox-row input { width: auto; }

.bullets { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bullet-row { display: grid; grid-template-columns: 1fr 26px; gap: 6px; align-items: center; }
.bullet-row .rm { background: none; border: none; color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 6px; padding: 4px; }
.bullet-row .rm:hover { background: #fee2e2; color: var(--danger); }
.bullet-row .rm svg { width: 14px; height: 14px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tag { display: flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; font-weight: 600; padding: 6px 8px 6px 12px; border-radius: 999px; }
.tag button { background: none; border: none; color: var(--brand-dark); display: flex; opacity: .6; }
.tag button:hover { opacity: 1; }
.tag button svg { width: 12px; height: 12px; }

.status-msg { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.status-msg.ok { background: #ecfdf5; color: #0f766e; }
.status-msg.err { background: #fef2f2; color: #b91c1c; }
.autosave-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ── Live preview (resume document look) ──────────────────────────── */
.preview-wrap { position: sticky; top: 90px; }
.preview { background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-lg); padding: 44px 40px; min-height: 500px; }
.preview.modern { border-top: 8px solid var(--brand); }

.r-name { font-size: 25px; font-weight: 800; letter-spacing: -.3px; }
.r-role { font-size: 13.5px; color: var(--brand-dark); font-weight: 700; margin-top: 2px; }
.r-contact { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.r-summary { font-size: 12.5px; color: #333; margin-top: 14px; line-height: 1.55; white-space: pre-wrap; }

.r-section { margin-top: 20px; }
.r-section-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--brand-dark); border-bottom: 1.5px solid var(--brand-border); padding-bottom: 4px; margin-bottom: 10px; }
.r-entry { margin-bottom: 12px; }
.r-entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.r-entry-title { font-size: 13px; font-weight: 700; }
.r-entry-sub { font-size: 12px; color: var(--muted); }
.r-entry-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.r-bullets { margin-top: 4px; padding-left: 16px; }
.r-bullets li { font-size: 12px; color: #333; line-height: 1.5; margin-bottom: 2px; }
.r-skills { font-size: 12px; color: #333; line-height: 1.7; }

/* ── Pro paywall modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,40,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 18px; padding: 28px; max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.pro-modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.pro-price { margin-bottom: 16px; }
.pro-price-amt { font-size: 28px; font-weight: 800; color: var(--brand-dark); }
.pro-price-note { font-size: 13.5px; color: var(--muted); }
.pro-features { padding-left: 20px; margin-bottom: 20px; color: #333; font-size: 14px; }
.pro-features li { margin-bottom: 6px; }
.pro-actions { display: flex; gap: 10px; }
.pro-actions .btn { flex: 1; }
.pro-msg:empty { margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* ── Restore-by-code (cross-device Pro unlock, no accounts) ───────── */
.restore-code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brand-soft); border: 1.5px dashed var(--brand-border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 18px;
}
.restore-code-value { font-size: 15px; font-weight: 700; letter-spacing: .3px; color: var(--brand-dark); word-break: break-all; }
.restore-code-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font-size: 15px; letter-spacing: .5px; margin-bottom: 14px; text-transform: uppercase;
}
.restore-code-input:focus { outline: none; border-color: var(--brand-light); }
.restore-link {
  display: block; width: 100%; text-align: center; background: none; border: none;
  color: var(--muted); font-size: 12.5px; margin-top: 12px; padding: 4px; text-decoration: underline;
}
.restore-link:hover { color: var(--brand-dark); }


/* ── Keyboard focus visibility (WCAG 2.4.7) — added from experience audit ── */
:focus-visible { outline: 2px solid var(--brand, currentColor); outline-offset: 2px; border-radius: 3px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .restore-code-input:focus-visible { outline: 2px solid var(--brand, currentColor); outline-offset: 1px; }
