/* ================================================================
   SaaS SEO Outline Tool v4
   Clean editorial dark/light split — centered stage panels
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ink:        #0D0F14;
  --ink-2:      #1A1D26;
  --ink-3:      #252836;
  --ink-4:      #323647;
  --muted:      #6B7189;
  --muted-lt:   #9CA3BF;
  --line:       #2A2D3E;
  --line-lt:    #E2E4EF;
  --white:      #FFFFFF;
  --off-white:  #F5F6FA;
  --accent:     #4F7EFF;
  --accent-lt:  #EEF3FF;
  --accent-dk:  #2D5CE8;
  --green:      #10B981;
  --green-lt:   #ECFDF5;
  --amber:      #F59E0B;
  --amber-lt:   #FFFBEB;
  --red:        #EF4444;
  --red-lt:     #FEF2F2;

  /* Step pill — shared gradient (same as step 3 accent) */
  --pill-grad:  linear-gradient(135deg, #4F7EFF 0%, #7C3AED 100%);

  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  14px;
  --shadow:     0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 12px 28px rgba(0,0,0,.11), 0 4px 8px rgba(0,0,0,.06);
  --font:       'DM Sans', -apple-system, sans-serif;
  --mono:       'DM Mono', monospace;
}

/* ── RESET ────────────────────────────────────────────────────── */
#sot-app, #sot-app * { box-sizing: border-box; font-family: var(--font); }
#sot-app { background: var(--off-white); min-height: 100vh; color: var(--ink); }
#sot-app h1,#sot-app h2,#sot-app h3 { margin: 0; line-height: 1.3; }
#sot-app p { margin: 0; }

/* ── TOPBAR ───────────────────────────────────────────────────── */
.sot-topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 28px; height: 58px;
  background: var(--ink-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.sot-topbar-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.sot-brand-icon { font-size: 18px; color: var(--accent); }
.sot-brand-name { font-size: 15px; font-weight: 700; color: var(--white); letter-spacing: -.01em; }
.sot-topbar-tabs { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.sot-tab {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 20px;
  background: transparent; border: 1.5px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.45); cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600; transition: all .18s;
}
.sot-tab:hover { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.25); }
.sot-tab.active {
  background: var(--accent); border-color: var(--accent); color: var(--white);
  box-shadow: 0 3px 10px rgba(79,126,255,.4);
}
.sot-tab-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: inherit;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--mono);
}
.sot-tab.active .sot-tab-num { background: rgba(255,255,255,.25); }
.sot-tab-label { font-size: 13px; }
.sot-tab-arrow { color: rgba(255,255,255,.25); font-size: 14px; }

/* ── KEYWORD BAR ──────────────────────────────────────────────── */
.sot-keyword-bar {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px;
  background: var(--ink-2); border-bottom: 1px solid var(--line);
  padding: 16px 28px;
}
.sot-kw-field { display: flex; flex-direction: column; gap: 7px; }
.sot-kw-field label {
  display: block; font-size: 10px; font-weight: 700; color: var(--muted-lt);
  text-transform: uppercase; letter-spacing: .09em;
}
.sot-kw-input-wrap {
  background: var(--white); border-radius: var(--radius-sm);
  border: 1.5px solid transparent; padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.sot-kw-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,126,255,.15);
}
.sot-kw-field input {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 14px; font-weight: 500;
  caret-color: var(--accent);
}
.sot-kw-field input::placeholder { color: #BEC3D4; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.sot-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; font-family: var(--font); line-height: 1;
}
.sot-btn-primary { background: var(--accent); color: var(--white); }
.sot-btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,126,255,.3); }
.sot-btn-ghost {
  background: var(--white); color: var(--ink-4);
  border: 1.5px solid var(--line-lt);
}
.sot-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.sot-btn-sm { padding: 7px 14px; font-size: 12.5px; }
.sot-btn-score {
  width: 100%; margin-top: 20px; padding: 13px 24px;
  font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, #4F7EFF 0%, #7C3AED 100%);
  color: var(--white); border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font);
  box-shadow: 0 4px 16px rgba(79,126,255,.35);
  transition: all .18s;
}
.sot-btn-score:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(79,126,255,.45); }

/* ── STAGES ───────────────────────────────────────────────────── */
.sot-stage { display: none; }
.sot-stage.active { display: block; }

/* Centered inner wrapper */
.sot-stage-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ── CARDS ────────────────────────────────────────────────────── */
.sot-card {
  background: var(--white); border: 1.5px solid var(--line-lt);
  border-radius: var(--radius-lg); padding: 28px 28px 24px;
  margin-bottom: 22px; box-shadow: var(--shadow);
}
/* Accent card (Step 3 style) */
.sot-card-accent {
  border-color: #93C5FD;
  background: linear-gradient(160deg, #F0F7FF 0%, #F8FBFF 100%);
}

.sot-card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.sot-card-header h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.sot-card-desc {
  font-size: 13.5px; color: var(--muted); line-height: 1.65;
  margin-bottom: 22px;
}

/* ── STEP PILL — unified gradient for all steps ───────────────── */
.sot-step-pill {
  background: var(--pill-grad);
  color: var(--white);
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  padding: 4px 11px; border-radius: 20px;
  letter-spacing: .04em; white-space: nowrap;
  flex-shrink: 0;
}

.sot-required-tag {
  background: #FEF2F2; color: #DC2626;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; flex-shrink: 0;
}

/* ── FORM FIELDS ──────────────────────────────────────────────── */
.sot-field { margin-bottom: 18px; }
.sot-field:last-child { margin-bottom: 0; }
.sot-field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}
.sot-field label small {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted); font-size: 12px;
}
.sot-field-icon { font-size: 14px; }
.sot-field input[type=text],
.sot-field input[type=url],
.sot-field input[type=number],
.sot-field select,
.sot-field textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--line-lt); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--ink); background: var(--white);
  transition: border-color .15s, box-shadow .15s; line-height: 1.55;
}
.sot-field input:focus,
.sot-field select:focus,
.sot-field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,126,255,.1);
}
.sot-field textarea { resize: vertical; }
.sot-hint {
  display: block; font-size: 11.5px; color: var(--muted-lt);
  margin-top: 5px; font-style: italic;
}
.sot-req { color: var(--red); }
.sot-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── MULTI-SELECT ─────────────────────────────────────────────── */
.sot-multi-select { display: flex; flex-direction: column; gap: 7px; }
.sot-ms-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1.5px solid var(--line-lt);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .15s; user-select: none;
}
.sot-ms-option:hover { border-color: var(--accent); background: var(--accent-lt); }
.sot-ms-option.selected { border-color: var(--accent); background: var(--accent-lt); }
.sot-ms-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #D1D5DB; flex-shrink: 0; transition: all .15s;
}
.sot-ms-option.selected .sot-ms-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--white);
}
.sot-ms-text { display: flex; flex-direction: column; gap: 1px; }
.sot-ms-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sot-ms-desc  { font-size: 11.5px; color: var(--muted); }

/* ── CHIP SELECT ──────────────────────────────────────────────── */
.sot-chips-select { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sot-chip-opt {
  padding: 6px 14px; border: 1.5px solid var(--line-lt);
  border-radius: 20px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all .15s;
  user-select: none;
}
.sot-chip-opt:hover { border-color: var(--accent); color: var(--accent); }
.sot-chip-opt.selected { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* ── SERP GRID ────────────────────────────────────────────────── */
.sot-serp-grid { overflow-x: auto; }
.sot-serp-head {
  display: grid; grid-template-columns: 28px 2fr 1.4fr 80px 2.5fr;
  gap: 10px; padding: 0 0 10px; margin-bottom: 6px;
  border-bottom: 1.5px solid var(--line-lt);
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.sot-serp-head small { font-weight: 400; text-transform: none; letter-spacing: 0; }
.sot-serp-row {
  display: grid; grid-template-columns: 28px 2fr 1.4fr 80px 2.5fr;
  gap: 10px; align-items: start;
  padding: 11px 0; border-bottom: 1px solid #F0F1F5;
}
.sot-serp-row:last-child { border-bottom: none; }
.sot-serp-num {
  font-size: 12px; font-weight: 700; color: var(--muted-lt);
  text-align: center; padding-top: 10px;
}
.sot-serp-row input[type=text],
.sot-serp-row input[type=number],
.sot-serp-row select,
.sot-serp-row textarea {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--line-lt); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--ink); font-family: var(--font);
  transition: border-color .15s;
}
.sot-serp-row textarea { resize: vertical; min-height: 58px; }
.sot-serp-row input:focus, .sot-serp-row select:focus, .sot-serp-row textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,126,255,.08);
}

/* ── PROMPT BOXES ─────────────────────────────────────────────── */
.sot-prompt-toggle {
  background: none; border: 1.5px solid var(--accent);
  color: var(--accent); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all .15s;
}
.sot-prompt-toggle:hover { background: var(--accent-lt); }
.sot-prompt-box {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1.5px solid #2A2D3E; margin-top: 12px;
}
.sot-prompt-bar {
  background: var(--ink-3); padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: #6EE7B7;
  font-family: var(--mono);
}
.sot-copy-prompt {
  background: var(--ink-4); color: #E5E7EB; border: none;
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer; font-family: var(--font); transition: all .15s;
}
.sot-copy-prompt:hover { background: var(--line); }
.sot-copy-prompt.copied { background: var(--green); color: var(--white); }
.sot-prompt-body {
  background: var(--ink); padding: 18px 20px;
  color: #C9D1E0; font-size: 12.5px; line-height: 1.9;
  font-family: var(--mono);
}
.sot-pl { display: block; }
.sot-pv { color: #FCD34D; }
.sot-pv-block {
  display: block; background: var(--ink-3);
  border-left: 3px solid #FCD34D;
  padding: 8px 12px; margin: 4px 0;
  border-radius: 0 4px 4px 0; color: #FCD34D; white-space: pre-wrap;
}

/* ── STAGE FOOTER ─────────────────────────────────────────────── */
.sot-stage-footer {
  display: flex; justify-content: flex-end;
  padding: 8px 0 0; gap: 12px;
}

/* ── SCORE PANEL ──────────────────────────────────────────────── */
.sot-score-panel {
  background: var(--white); border: 1.5px solid var(--line-lt);
  border-radius: var(--radius-lg); padding: 32px;
  margin-bottom: 22px; box-shadow: var(--shadow-md);
}
.sot-score-hero {
  display: flex; align-items: center; gap: 32px;
  padding-bottom: 28px; border-bottom: 1.5px solid #F0F1F5;
  margin-bottom: 28px;
}
.sot-score-ring-wrap {
  position: relative; flex-shrink: 0; width: 120px; height: 120px;
}
.sot-score-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.sot-ring-track  { fill: none; stroke: #F0F1F5; stroke-width: 10; }
.sot-ring-fill   {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .4s;
}
.sot-score-num-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; display: flex; align-items: baseline; gap: 2px;
}
.sot-score-num  { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1; }
.sot-score-denom{ font-size: 13px; font-weight: 600; color: var(--muted); }
.sot-score-verdict { flex: 1; }
.sot-score-grade { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.sot-score-summary { font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 460px; }

/* Breakdown */
.sot-score-breakdown {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px;
}
.sot-breakdown-item {
  padding: 14px 16px; border: 1.5px solid #F0F1F5;
  border-radius: var(--radius); background: var(--off-white);
}
.sot-breakdown-item.pass    { border-color: #6EE7B7; background: var(--green-lt); }
.sot-breakdown-item.partial { border-color: #FCD34D; background: var(--amber-lt); }
.sot-breakdown-item.fail    { border-color: #FCA5A5; background: var(--red-lt); }
.sot-bd-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.sot-bd-label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.sot-bd-pts   { font-size: 13px; font-weight: 800; font-family: var(--mono); }
.sot-breakdown-item.pass    .sot-bd-pts { color: var(--green); }
.sot-breakdown-item.partial .sot-bd-pts { color: #D97706; }
.sot-breakdown-item.fail    .sot-bd-pts { color: var(--red); }
.sot-bd-bar { height: 4px; background: rgba(0,0,0,.07); border-radius: 2px; overflow: hidden; margin-bottom: 7px; }
.sot-bd-bar-fill { height: 100%; border-radius: 2px; transition: width .8s ease; }
.sot-breakdown-item.pass    .sot-bd-bar-fill { background: var(--green); }
.sot-breakdown-item.partial .sot-bd-bar-fill { background: var(--amber); }
.sot-breakdown-item.fail    .sot-bd-bar-fill { background: var(--red); }
.sot-bd-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.sot-score-missing {
  background: #FFF8F0; border: 1.5px solid #FCD34D;
  border-radius: var(--radius); padding: 18px 20px;
}
.sot-missing-header { font-size: 13px; font-weight: 700; color: #92400E; margin-bottom: 12px; }
.sot-missing-list { display: flex; flex-direction: column; gap: 7px; }
.sot-missing-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: #78350F;
}
.sot-missing-item::before { content: '→'; flex-shrink: 0; font-weight: 700; }

/* ── TOAST ────────────────────────────────────────────────────── */
#sot-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--ink-2); color: var(--white);
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translateY(60px); opacity: 0;
  transition: all .25s cubic-bezier(.4,0,.2,1); pointer-events: none;
}
#sot-toast.show  { transform: translateY(0); opacity: 1; }
#sot-toast.success { background: var(--green); }
#sot-toast.error   { background: var(--red); }
#sot-toast.info    { background: var(--accent); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 820px) {
  .sot-two-col { grid-template-columns: 1fr; }
  .sot-keyword-bar { grid-template-columns: 1fr; row-gap: 12px; padding: 14px 16px; column-gap: 0; }
  .sot-score-breakdown { grid-template-columns: 1fr; }
  .sot-score-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .sot-topbar { padding: 0 16px; }
  .sot-stage-inner { padding: 20px 16px 40px; }
  .sot-card { padding: 20px 16px; }
}
@media (max-width: 640px) {
  .sot-tab-label { display: none; }
  .sot-tab { padding: 7px 12px; }
  .sot-serp-head, .sot-serp-row {
    grid-template-columns: 24px 1.5fr 1fr;
  }
  /* hide word count + keywords columns on mobile */
  .sot-serp-head span:nth-child(4),
  .sot-serp-head span:nth-child(5),
  .sot-serp-row input[type=number],
  .sot-serp-row textarea { display: none; }
}
