/* ============================================================
   TalentSphere HUB — ATS CV Checker
   Brand: Primary #00788c · Bright #00b4b4 · Dark #1a3840
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #00788c;
  --bright:       #00b4b4;
  --dark:         #1a3840;
  --light-bg:     #f0f9fa;
  --border:       #d1eaed;
  --text:         #1a2e35;
  --text-muted:   #5a7a82;
  --success:      #0d9b6e;
  --success-bg:   #e6f7f2;
  --danger:       #d63232;
  --danger-bg:    #fdeaea;
  --warn:         #c47f00;
  --warn-bg:      #fff8e6;
  --white:        #ffffff;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --radius:       12px;
  --radius-lg:    18px;
  --radius-pill:  100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #f7fafa;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark);
}

.logo-icon { height: 96px; width: auto; flex-shrink: 0; object-fit: contain; border-radius: 0; background: none; }

.logo-wordmark {
  font-size: 1rem;
  font-weight: 500;
  color: var(--dark);
  letter-spacing: -0.01em;
}

.logo-wordmark strong {
  font-weight: 800;
  color: var(--primary);
}

.header-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--light-bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.2s;
}

.btn-back:hover { color: var(--primary); border-color: var(--primary); background: var(--light-bg); }
.btn-back svg { width: 15px; height: 15px; }

.btn-download {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download:hover { background: var(--dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-download svg { width: 15px; height: 15px; }

/* ============================================================
   HERO — Upload Page
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #0d4f5e 50%, var(--primary) 100%);
  color: var(--white);
  padding: 72px 0 64px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bright);
  border: 1px solid rgba(0,180,180,0.4);
  background: rgba(0,180,180,0.1);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============================================================
   MAIN PANELS — Upload Page
   ============================================================ */
.main-panels {
  padding: 48px 24px;
}

.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .panels-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cv-icon { background: var(--light-bg); color: var(--primary); }
.jd-icon { background: #e8f4f6; color: var(--primary); }
.panel-icon svg { width: 22px; height: 22px; }

.panel-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.panel-sub { font-size: 0.82rem; color: var(--text-muted); }

/* Saved CV notice */
.saved-cv-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #a8e6d3;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.saved-cv-notice svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-clear-cv {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--success);
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
}

.btn-clear-cv:hover { opacity: 1; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--light-bg);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: #e6f4f6;
}

.drop-zone-content { text-align: center; padding: 24px; }

.drop-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  margin: 0 auto 12px;
  display: block;
}

.drop-primary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}

.drop-secondary {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.btn-browse {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.drop-formats {
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.file-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  width: 100%;
}

.file-selected svg { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }
.file-selected span { font-size: 0.9rem; font-weight: 500; color: var(--dark); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-remove-file:hover { color: var(--danger); background: var(--danger-bg); }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.privacy-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* JD Textarea */
.jd-textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--light-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}

.jd-textarea:focus { border-color: var(--primary); background: var(--white); }
.jd-textarea::placeholder { color: var(--text-muted); }

.jd-char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: right;
}

.jd-tip { color: var(--primary); font-weight: 500; }

/* Analyse row */
.analyse-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.btn-analyse {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  padding: 16px 40px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,120,140,0.35);
  letter-spacing: -0.01em;
}

.btn-analyse:hover:not(:disabled) {
  background: var(--dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,120,140,0.45);
}

.btn-analyse:disabled {
  background: #b0cdd2;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-analyse svg { width: 18px; height: 18px; }

.analyse-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how-section {
  background: var(--dark);
  padding: 72px 0;
  margin-top: 16px;
}

.how-section .section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 640px) {
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
}

.step { text-align: center; }

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step h3 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.step p { font-size: 0.875rem; color: rgba(255,255,255,0.65); line-height: 1.6; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo .logo-wordmark { font-size: 0.875rem; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,56,64,0.88);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-title { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.loading-sub { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }

.loading-steps { display: flex; flex-direction: column; gap: 12px; }

.loading-step {
  font-size: 1rem;
  font-weight: 500;
  color: var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  transition: color 0.4s;
}

.loading-step::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.loading-step.active { color: var(--primary); }
.loading-step.done { color: var(--success); }

/* ============================================================
   RESULTS PAGE
   ============================================================ */
.results-main {
  padding: 40px 24px 80px;
}

.results-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-heading svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.section-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 20px; margin-top: -12px; }

/* Score Hero */
.score-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #0d4f5e 60%, var(--primary) 100%);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 24px;
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.score-hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.score-circle-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.score-ring { width: 140px; height: 140px; }
.score-track { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 10; }

.score-fill {
  fill: none;
  stroke: var(--bright);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4,0,0.2,1);
}

.score-number-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.score-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); font-weight: 500; margin-top: 2px; }

.score-summary { flex: 1; min-width: 200px; }
.score-heading { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.score-verdict { font-size: 1.5rem; font-weight: 700; color: var(--white); line-height: 1.3; margin-bottom: 20px; }

.score-meta {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.score-meta-item { text-align: center; padding: 0 20px; }
.score-meta-item:first-child { padding-left: 0; }
.score-meta-val { display: block; font-size: 1.5rem; font-weight: 800; color: var(--bright); line-height: 1; margin-bottom: 4px; }
.score-meta-label { font-size: 0.75rem; color: rgba(255,255,255,0.6); font-weight: 500; }
.score-meta-divider { width: 1px; background: rgba(255,255,255,0.2); margin: 4px 0; }

/* Keyword Coverage */
.coverage-bar-wrap { margin-bottom: 24px; }

.coverage-bar-track {
  height: 14px;
  background: var(--light-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.coverage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--bright));
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.coverage-stats { display: flex; align-items: baseline; gap: 8px; }
.coverage-pct { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.coverage-label { font-size: 0.875rem; color: var(--text-muted); }

.keyword-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 640px) {
  .keyword-cols { grid-template-columns: 1fr; }
}

.keyword-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.keyword-col-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.keyword-col-title.found { color: var(--success); }
.keyword-col-title.missing { color: var(--danger); }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}

.pill-found { background: var(--success-bg); color: var(--success); border: 1px solid #b0e8d4; }
.pill-missing { background: var(--danger-bg); color: var(--danger); border: 1px solid #f4c0c0; }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.category-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--light-bg);
}

.category-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dark);
}

.category-score-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.cat-good { background: var(--success-bg); color: var(--success); }
.cat-mid { background: var(--warn-bg); color: var(--warn); }
.cat-low { background: var(--danger-bg); color: var(--danger); }

.category-bar-track {
  height: 6px;
  background: #e0ecef;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 14px;
}

.category-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--bright));
  transition: width 1s ease;
}

.category-pills-wrap { display: flex; flex-direction: column; gap: 8px; }

.category-pill-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.cat-row-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 48px;
}

/* Two-col strengths/gaps */
.two-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .two-col-section { grid-template-columns: 1fr; }
}

.two-col-section .results-section { margin-bottom: 0; }

.strengths-heading { color: var(--dark); }
.strengths-heading svg { color: #f5a623; }
.gaps-heading svg { color: var(--danger); }

.check-list, .warn-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.check-list li, .warn-list li {
  display: flex;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  align-items: flex-start;
}

.check-list li::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--success-bg);
  border: 1.5px solid var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%230d9b6e' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

.warn-list li::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--danger-bg);
  border: 1.5px solid var(--danger);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23d63232' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Improvements */
.improvements-list { display: flex; flex-direction: column; gap: 12px; }

.improvement-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
}

.improvement-card.priority-high {
  border-left: 4px solid var(--danger);
  background: #fff9f9;
}

.improvement-card.priority-medium {
  border-left: 4px solid var(--warn);
  background: #fffdf5;
}

.priority-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 1px;
}

.badge-high { background: var(--danger-bg); color: var(--danger); }
.badge-medium { background: var(--warn-bg); color: var(--warn); }

.improvement-text { font-size: 0.875rem; line-height: 1.6; color: var(--text); }

/* Quick Wins */
.quick-wins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.quick-win-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quick-win-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--white);
}

.quick-win-icon svg { width: 14px; height: 14px; }
.quick-win-text { font-size: 0.845rem; line-height: 1.5; color: var(--text); }

/* Missing keyword suggestions */
.suggestions-list { display: flex; flex-direction: column; gap: 14px; }

.suggestion-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.suggestion-keyword {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--light-bg);
  border-bottom: 1px solid var(--border);
}

.suggestion-kw-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suggestion-kw-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: white;
  border: 1.5px solid var(--primary);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.suggestion-text {
  padding: 12px 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--bright);
  margin: 8px 12px;
  border-radius: 2px;
  background: #f8fcfd;
  font-style: italic;
}

.suggestion-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-copy-btn:hover { background: var(--light-bg); border-color: var(--primary); }
.suggestion-copy-btn svg { width: 12px; height: 12px; }

/* ATS Formatting Grid */
.formatting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.formatting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--light-bg);
}

.formatting-label { font-size: 0.875rem; font-weight: 600; color: var(--dark); }
.formatting-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.fmt-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fmt-yes { background: var(--success-bg); color: var(--success); }
.fmt-no { background: var(--danger-bg); color: var(--danger); }
.fmt-warn { background: var(--warn-bg); color: var(--warn); }

/* ============================================================
   UPSELL SECTION
   ============================================================ */
.upsell-section {
  background: linear-gradient(135deg, var(--dark) 0%, #0d4f5e 60%, var(--primary) 100%);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.upsell-section::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(0,180,180,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.upsell-inner { position: relative; z-index: 1; }

.upsell-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bright);
  border: 1px solid rgba(0,180,180,0.5);
  background: rgba(0,180,180,0.1);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.upsell-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.2;
}

.upsell-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.upsell-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}

.price-from { font-size: 0.9rem; color: rgba(255,255,255,0.65); font-weight: 500; }
.price-amount { font-size: 3rem; font-weight: 800; color: var(--bright); line-height: 1; letter-spacing: -0.04em; }
.price-note { font-size: 0.9rem; color: rgba(255,255,255,0.65); font-weight: 500; }


.upsell-trust { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-bottom: 28px; }

.upsell-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bright);
  color: var(--dark);
  font-size: 1rem;
  font-weight: 800;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0,180,180,0.35);
}

.upsell-cta-btn:hover {
  background: #00cece;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,180,180,0.5);
}

.upsell-cta-btn svg { width: 18px; height: 18px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-section, .score-hero, .upsell-section {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.score-hero          { animation-delay: 0.05s; }
.results-section:nth-child(1) { animation-delay: 0.10s; }
.results-section:nth-child(2) { animation-delay: 0.15s; }
.results-section:nth-child(3) { animation-delay: 0.20s; }
.results-section:nth-child(4) { animation-delay: 0.25s; }
.results-section:nth-child(5) { animation-delay: 0.30s; }
.results-section:nth-child(6) { animation-delay: 0.35s; }
.results-section:nth-child(7) { animation-delay: 0.40s; }
.upsell-section      { animation-delay: 0.45s; }

/* Error state */
.error-banner {
  background: var(--danger-bg);
  border: 1px solid #f4c0c0;
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .header-inner { gap: 8px; }
  .logo-wordmark { font-size: 0.875rem; }
  .header-tag { display: none; }
  .score-hero { padding: 28px 20px; }
  .score-hero-inner { gap: 20px; }
  .results-section { padding: 24px 18px; }
  .upsell-section { padding: 40px 20px; }
}

/* ============================================================
   REWRITE CV BUTTON
   ============================================================ */
.btn-rewrite-cv {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--light-bg);
  border: 1.5px solid var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-rewrite-cv:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-rewrite-cv svg { width: 15px; height: 15px; }

/* ============================================================
   DOWNLOAD MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 36, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-overlay.modal-visible { opacity: 1; }
.modal-overlay.modal-visible .modal-card { transform: translateY(0); opacity: 1; }

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover { background: var(--light-bg); color: var(--dark); }

.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--light-bg);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--primary);
}

.modal-icon svg { width: 24px; height: 24px; }

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-form { display: flex; flex-direction: column; gap: 16px; }

.modal-field { display: flex; flex-direction: column; gap: 6px; }

.modal-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
}

.modal-field input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

.modal-field input:focus { border-color: var(--primary); }
.modal-field input::placeholder { color: #b0c8cd; }

.modal-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-privacy svg { width: 13px; height: 13px; flex-shrink: 0; }

.modal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.modal-submit:hover { background: var(--dark); transform: translateY(-1px); }
.modal-submit svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .modal-card { padding: 28px 20px; }
  .btn-rewrite-cv span { display: none; }
}

/* ============================================================
   REWRITE PAGE
   ============================================================ */
.rewrite-loading {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.rewrite-main { padding: 48px 24px 80px; }

.rewrite-header {
  text-align: center;
  margin-bottom: 40px;
}

.rewrite-header-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--light-bg);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.rewrite-header-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.rewrite-header-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tabs */
.rw-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.rw-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 20px;
  background: var(--white);
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: all 0.18s;
  min-width: 180px;
}

.rw-tab:hover { border-color: var(--primary); background: var(--light-bg); }

.rw-tab-active {
  border-color: var(--primary);
  background: var(--white);
  position: relative;
}

.rw-tab-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--white);
}

.rw-tab-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 3px;
}

.rw-tab-active .rw-tab-name { color: var(--primary); }

.rw-tab-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Panels */
.rw-panel {
  display: none;
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: 0 10px 10px 10px;
  overflow: hidden;
}

.rw-panel-active { display: block; }

.rw-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--light-bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.rw-panel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rw-panel-info strong { font-size: 0.9rem; color: var(--dark); }
.rw-panel-info span   { font-size: 0.78rem; color: var(--text-muted); }

.rw-panel-actions { display: flex; gap: 10px; flex-shrink: 0; }

.rw-btn-copy, .rw-btn-download {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
}

.rw-btn-copy:hover    { border-color: var(--primary); color: var(--primary); background: var(--light-bg); }
.rw-btn-download      { background: var(--primary); color: var(--white); border-color: var(--primary); }
.rw-btn-download:hover { background: var(--dark); border-color: var(--dark); }
.rw-btn-copy svg, .rw-btn-download svg { width: 14px; height: 14px; }

.rw-cv-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Inter', monospace;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text);
  padding: 28px 28px 36px;
  margin: 0;
  background: var(--white);
}

@media (max-width: 640px) {
  .rw-tab { min-width: unset; flex: 1; }
  .rw-tabs { gap: 6px; }
  .rw-panel { border-radius: 0 0 10px 10px; }
  .rw-panel-toolbar { flex-direction: column; align-items: flex-start; }
  .rw-cv-text { padding: 20px 16px 28px; font-size: 0.82rem; }
}
