/* ═══════════════════════════════════════════════════════
   NoBroker Hiring AI — Design System
   Theme: Cloned from nobroker.com + nobrokerhood.com
   Primary: #E42B34 (NoBroker Red) | White bg | Clean, professional
═══════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ────────────────────────────────────── */
:root {
  --red:          #E42B34;
  --red-dark:     #C0212A;
  --red-hover:    #B01D25;
  --red-light:    #FFF0F1;
  --red-border:   #F5B3B6;

  --white:        #FFFFFF;
  --bg:           #F7F8FA;
  --bg-card:      #FFFFFF;
  --bg-input:     #FAFAFA;

  --text-dark:    #1C1C1E;
  --text-medium:  #4A4A4A;
  --text-light:   #888888;
  --text-xlight:  #BBBBBB;

  --border:       #E5E7EB;
  --border-focus: #E42B34;

  --green:        #1DAF5A;
  --green-light:  #E8F7EF;
  --amber:        #F59E0B;
  --amber-light:  #FFF8E7;

  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.10);
  --shadow-red:   0 4px 20px rgba(228,43,52,0.20);

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    20px;

  --header-h:     68px;
  --max-w:        1080px;
  --transition:   all 0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }

/* ─── Utility ───────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

/* ─── HEADER (NoBroker style) ───────────────────────────── */
.nb-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.nb-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ─── NoBroker Logo ─────────────────────────────────────── */
.nb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nb-logo:hover { opacity: 0.9; }

.nb-logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.nb-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nb-logo-name {
  font-size: 21px;
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.nb-logo-name span.dot-com {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0;
}

.nb-logo-tagline {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── Header Nav ─────────────────────────────────────────── */
.nb-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nb-nav-label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.nb-nav-label strong {
  color: var(--text-medium);
  font-weight: 600;
}

.btn-header-outline {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
}

.btn-header-outline:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-header-primary {
  padding: 9px 20px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-header-primary:hover {
  background: var(--red-dark);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 36px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-light);
  color: var(--red);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
  letter-spacing: -0.5px;
  max-width: 640px;
}

.hero h1 em {
  color: var(--red);
  font-style: normal;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-medium);
  max-width: 520px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 8px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-stat strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
}

.hero-stat span {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* ─── Main Content Area ───────────────────────────────────── */
.main-content {
  padding: 32px 0 64px;
}

/* ─── Form Cards ──────────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.form-card:focus-within {
  border-color: var(--red-border);
  box-shadow: var(--shadow-md);
}

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

.step-badge {
  width: 32px;
  height: 32px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content:: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  justify-content: center;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

.card-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-light);
  padding: 3px 10px;
  border-radius: 12px;
}

/* ─── Input Tabs (Manual / Upload JD) ───────────────────── */
.input-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}

.tab-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  cursor: pointer;
}

.tab-btn:hover { color: var(--red); }

.tab-btn.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Form Groups ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--bg-input);
  transition: var(--transition);
  resize: vertical;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-xlight);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--red);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(228, 43, 52, 0.08);
}

/* ─── File Drop Zones ────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--red);
  background: var(--red-light);
}

.drop-zone.has-file {
  border-color: var(--green);
  background: var(--green-light);
  border-style: solid;
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-xlight);
}

.drop-zone.drag-over .drop-zone-icon,
.drop-zone:hover .drop-zone-icon { color: var(--red); }

.drop-zone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.drop-zone-sub {
  font-size: 13px;
  color: var(--text-light);
}

.drop-zone-sub .browse-link {
  color: var(--red);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.drop-zone-formats {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-xlight);
  font-weight: 500;
}

/* ─── Resume File List ───────────────────────────────────── */
.resume-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}

.resume-count-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
}

.resume-count-text .count-num {
  color: var(--red);
  font-size: 16px;
  font-weight: 800;
}

.clear-btn {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.clear-btn:hover { color: var(--red); border-color: var(--red); }

.file-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-medium);
  font-weight: 500;
  max-width: 220px;
}

.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip .remove-chip {
  color: var(--text-xlight);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.file-chip .remove-chip:hover { color: var(--red); }

/* ─── Quick-pick N buttons ───────────────────────────────── */
.quick-n-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
}

.quick-n-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.quick-n-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ─── Submit Button ──────────────────────────────────────── */
.submit-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-shortlist {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 48px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  max-width: 400px;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-red);
}

.btn-shortlist:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(228,43,52,0.30);
}

.btn-shortlist:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-hint {
  font-size: 12px;
  color: var(--text-xlight);
}

/* ─── Error Message ──────────────────────────────────────── */
.error-box {
  background: #FFF0F1;
  border: 1.5px solid #FFCDD0;
  border-radius: var(--radius);
  padding: 14px 18px;
  color: #C02028;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ─── Loading Overlay ────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 30, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

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

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

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

.loading-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  transition: var(--transition);
}

.loading-step.active { color: var(--red); font-weight: 600; }
.loading-step.done   { color: var(--green); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.loading-step.active .step-dot { background: var(--red); }
.loading-step.done   .step-dot { background: var(--green); }

/* ═══════════════════════════════════════════════════════════
   RESULTS PAGE
═══════════════════════════════════════════════════════════ */

.results-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}

.results-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.results-title-group h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.results-title-group p {
  font-size: 14px;
  color: var(--text-light);
}

.results-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.results-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.results-meta-item .val {
  font-size: 24px;
  font-weight: 800;
  color: var(--red);
}

.results-meta-item .lbl {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jd-preview-strip {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.jd-preview-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.jd-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-light);
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jd-preview-text {
  font-size: 13px;
  color: var(--text-medium);
  line-height: 1.5;
}

.results-list {
  padding: 32px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Candidate Card ──────────────────────────────────────── */
.candidate-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.candidate-card:hover {
  border-color: var(--red-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.candidate-card.rank-1 { border-left: 4px solid #FFD700; }
.candidate-card.rank-2 { border-left: 4px solid #C0C0C0; }
.candidate-card.rank-3 { border-left: 4px solid #CD7F32; }
.candidate-card.rank-other { border-left: 4px solid var(--red); }

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.rank-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}

.rank-badge.r1 { background: #FFF8DC; color: #D4A017; border: 2px solid #FFD700; }
.rank-badge.r2 { background: #F5F5F5; color: #808080; border: 2px solid #C0C0C0; }
.rank-badge.r3 { background: #FFF0E6; color: #8B4513; border: 2px solid #CD7F32; }
.rank-badge.rn { background: var(--red-light); color: var(--red); border: 2px solid var(--red-border); }

.candidate-info { flex: 1; }

.candidate-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.candidate-role {
  font-size: 13px;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.candidate-edu {
  font-size: 12px;
  color: var(--text-light);
}

.score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.score-number {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.score-number.high   { color: var(--green); }
.score-number.medium { color: var(--amber); }
.score-number.low    { color: var(--red); }

.score-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-bar {
  width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.score-fill.high   { background: var(--green); }
.score-fill.medium { background: var(--amber); }
.score-fill.low    { background: var(--red); }

/* ─── Skills Chips ────────────────────────────────────────── */
.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.skill-chip {
  padding: 4px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-medium);
}

.exp-chip {
  padding: 4px 12px;
  background: var(--red-light);
  border: 1.5px solid var(--red-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

/* ─── Strengths / Concerns / Verdict ─────────────────────── */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.analysis-block {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
}

.analysis-block.strengths {
  background: var(--green-light);
  border: 1px solid #BBE8D2;
}

.analysis-block.concerns {
  background: var(--amber-light);
  border: 1px solid #FCDFA6;
}

.analysis-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.analysis-label.green { color: var(--green); }
.analysis-label.amber { color: #B45309; }

.verdict-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.verdict-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green);
}

.verdict-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.filename-tag {
  font-size: 11px;
  color: var(--text-xlight);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ─── Back Button ─────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-back:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ─── Footer ──────────────────────────────────────────────── */
.nb-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.6);
  padding: 20px 0;
  font-size: 13px;
  text-align: center;
  border-top: 3px solid var(--red);
}

.nb-footer strong { color: white; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid         { grid-template-columns: 1fr; }
  .analysis-grid     { grid-template-columns: 1fr; }
  .hero h1           { font-size: 26px; }
  .hero-stats        { gap: 24px; }
  .nb-nav-label      { display: none; }
  .results-meta      { gap: 16px; }
  .card-top          { flex-wrap: wrap; }
  .score-block       { flex-direction: row; align-items: center; gap: 10px; }
}

@media (max-width: 480px) {
  .form-card         { padding: 20px 16px; }
  .candidate-card    { padding: 18px 16px; }
  .hero h1           { font-size: 22px; }
  .hero-stats        { flex-wrap: wrap; justify-content: center; gap: 20px; }
}
