@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:      #0A66C2;
  --primary-dark: #004182;
  --primary-light:#EBF3FB;
  --success:      #16A34A;
  --success-light:#DCFCE7;
  --warning:      #D97706;
  --warning-light:#FEF9C3;
  --danger:       #DC2626;
  --danger-light: #FEE2E2;
  --bg:           #F8FAFC;
  --surface:      #FFFFFF;
  --border:       #E2E8F0;
  --text:         #1E293B;
  --text-muted:   #64748B;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    12px;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; max-width: 100%; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* ── FORMS ── */
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 1rem; font-family: inherit;
  color: var(--text); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,102,194,0.15);
}
.textarea { resize: vertical; min-height: 160px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 6px; color: var(--text); }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 6px; }

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-body { padding: 24px; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.nav.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.10); }
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 700px) { .nav-links { display: none; } .nav-inner { padding: 0 16px; } }
@media (max-width: 480px) { .nav-actions .btn-sm { padding: 6px 10px; font-size: 0.8rem; } }

/* ── SCORE BADGES ── */
.score-badge {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: var(--radius);
  font-weight: 700; border: 1.5px solid; flex-shrink: 0;
}
.score-badge .score-num { font-size: 1.5rem; line-height: 1; }
.score-badge .score-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.score-strong { background: var(--success-light); color: var(--success); border-color: var(--success); }
.score-good   { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.score-weak   { background: var(--danger-light);  color: var(--danger);  border-color: var(--danger);  }

.score-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; border: 1px solid;
}

/* ── CAREER FLAG BADGES ── */
.flag-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.flag-strong-trajectory { background: #DBEAFE; color: #1D4ED8; }
.flag-job-hopper        { background: #FEE2E2; color: #DC2626; }
.flag-overqualified     { background: #F3E8FF; color: #7C3AED; }
.flag-underqualified    { background: #FFF7ED; color: #C2410C; }
.flag-career-changer    { background: #F0FDF4; color: #15803D; }

/* ── PLAN BADGES ── */
.plan-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
}
.plan-free         { background: #F1F5F9; color: #64748B; }
.plan-payperreport { background: #EBF3FB; color: #0A66C2; }
.plan-starter      { background: #F0FDF4; color: #16A34A; }
.plan-pro          { background: #EBF3FB; color: #0A66C2; }
.plan-agency       { background: #FDF4FF; color: #7C3AED; }

/* ── PILL TAGS ── */
.pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; border: 1px solid;
}
.pill-primary { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pill-muted   { background: #F1F5F9; color: var(--text-muted); border-color: var(--border); }

/* ── AUTOCOMPLETE ── */
.autocomplete-wrapper { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 280px; overflow-y: auto; display: none;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-option {
  padding: 10px 12px; cursor: pointer; font-size: 0.95rem;
  transition: background 0.1s;
}
.autocomplete-option:hover,
.autocomplete-option.active { background: var(--primary-light); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto;
  position: relative; box-sizing: border-box;
}
.modal-header {
  padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-body { padding: 20px 28px 28px; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 1.4rem; line-height: 1; padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
@media (max-width: 600px) { .modal-overlay { padding: 16px; } .modal { width: calc(100vw - 32px); } }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── DROP ZONE ── */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text-muted);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.drop-zone .dz-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.drop-zone .dz-title { font-weight: 600; color: var(--text); }
.drop-zone .dz-sub { font-size: 0.85rem; margin-top: 4px; }

/* ── LOADING OVERLAY ── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(248,250,252,0.97); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; text-align: center;
}
.loading-overlay.hidden { display: none; }
.loading-logo { font-size: 2rem; font-weight: 700; color: var(--primary); }
.loading-status { font-size: 1.05rem; color: var(--text-muted); min-height: 28px; transition: opacity 0.3s; }
.progress-bar-track {
  width: 360px; max-width: 90vw; height: 6px;
  background: var(--border); border-radius: 999px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 40%; background: var(--primary); border-radius: 999px;
  animation: progress-indeterminate 1.8s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); width: 40%; }
  50%  { width: 60%; }
  100% { transform: translateX(280%); width: 40%; }
}

/* ── SPINNER ── */
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ALERT BANNERS ── */
.alert {
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 0.95rem;
  margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-light); color: var(--primary); border: 1px solid #93c5fd; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
thead th {
  padding: 10px 14px; text-align: left; font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── SLIDER ── */
.slider { width: 100%; -webkit-appearance: none; height: 6px; border-radius: 999px; background: var(--border); outline: none; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.15);
}
.slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary);
  cursor: pointer; border: none;
}

/* ── SCORE DISTRIBUTION BAR ── */
.dist-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; }
.dist-seg { height: 100%; border-radius: 999px; min-width: 4px; transition: width 0.5s ease; }
.dist-strong { background: var(--success); }
.dist-good   { background: var(--warning); }
.dist-weak   { background: var(--danger); }

/* ── SECTION HELPERS ── */
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.section-title { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.section-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 580px; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-title { font-size: 1.5rem; }
  .nav-links { display: none; }
}

/* ── CANDIDATE CARD ── */
.candidate-card { margin-bottom: 16px; overflow: hidden; word-wrap: break-word; overflow-wrap: break-word; }
.candidate-header { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; flex-wrap: wrap; }
.candidate-rank { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); min-width: 28px; padding-top: 4px; }
.candidate-info { flex: 1; }
.candidate-name { font-size: 1.05rem; font-weight: 700; }
.candidate-meta { font-size: 0.88rem; color: var(--text-muted); margin-top: 2px; }
.candidate-location { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.candidate-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.candidate-body { padding: 0 24px 20px; border-top: 1px solid var(--border); }
.candidate-section { padding: 12px 0; border-bottom: 1px solid var(--bg); }
.candidate-section:last-child { border-bottom: none; }
.candidate-section-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.verdict-text { font-style: italic; color: var(--text); }
.strengths-list, .gaps-list { list-style: none; padding: 0; }
.strengths-list li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.gaps-list li::before { content: "• "; color: var(--warning); }
.outreach-text { color: var(--text); background: var(--primary-light); padding: 10px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--primary); font-size: 0.92rem; }
.linkedin-link { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.linkedin-link:hover { text-decoration: underline; }

/* ── FOOTER ── */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0; margin-top: auto; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-brand { font-weight: 700; font-size: 1.1rem; color: var(--primary); margin-bottom: 6px; display: block; }
.footer-desc { font-size: 0.85rem; color: var(--text-muted); max-width: 300px; margin: 0; }
.footer-links { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-disclaimer { font-size: 0.78rem; color: var(--text-muted); padding-top: 16px; border-top: 1px solid var(--border); line-height: 1.6; }
@media (max-width: 640px) { .footer-inner { flex-direction: column; gap: 20px; } .footer-links { gap: 16px; } }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .score-badge { width: 52px; height: 52px; }
  .candidate-name { font-size: 0.95rem; }
}

/* ── LOGO SIZE ── */
.nav-logo img, .topbar-logo img, .auth-logo img, .verify-logo img, .reset-logo img {
  height: 38px;
  width: auto;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .nav-logo img, .topbar-logo img, .auth-logo img, .verify-logo img, .reset-logo img {
    height: 32px;
  }

  /* Global container padding */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Report page */
  .report-header,
  .candidate-card,
  .card {
    padding: 16px;
  }

  /* Report header buttons overflow fix */
  .report-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .report-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  /* Skills pills wrap cleanly */
  .skills-pills {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Dashboard topbar */
  .topbar {
    padding: 0 16px;
  }
  .topbar-right {
    gap: 8px;
  }
  .topbar-right .btn {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
  #userEmail {
    display: none;
  }

  /* Dashboard main padding */
  .main {
    padding: 16px;
  }
  .credit-card {
    padding: 16px;
  }
  .stats-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .new-search-card {
    padding: 20px 16px;
  }

  /* Pricing page */
  .pricing-page {
    padding: 32px 16px 48px;
  }
  .otp-card {
    padding: 20px 16px;
  }
  .pricing-card {
    padding: 24px 16px 20px;
  }

  /* Legal pages */
  .legal-page {
    padding: 48px 16px 48px;
  }
  .contact-page {
    padding: 48px 16px 48px;
  }

  /* Auth page */
  .auth-card,
  .card.auth-card {
    padding: 24px 16px;
    margin: 16px;
  }

  /* Report page — meta grid */
  .report-meta-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .score-stats {
    flex-wrap: wrap;
    gap: 12px;
  }
  .candidate-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .score-badge {
    width: 52px;
    height: 52px;
  }
  .score-num {
    font-size: 1.2rem;
  }
}

/* ── PRINT ── */
@media print {
  .no-print { display: none !important; }
  .nav, .footer, .btn, .modal-overlay, .loading-overlay { display: none !important; }
  body { background: #fff; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .candidate-card { page-break-inside: avoid; break-inside: avoid; }
  .score-badge, .score-pill, .flag-badge, .plan-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dist-seg, .dist-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 1.5cm; size: A4; }
}
