/* JobHunter AI — Main Stylesheet */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #2563eb;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); }

/* Navbar (landing) */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: white; box-shadow: var(--shadow); }
.nav-brand { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text); }

/* Hero */
.hero { text-align: center; padding: 6rem 2rem 4rem; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; color: var(--text); }
.hero p { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.trial-note { color: var(--secondary); margin-top: 1rem; font-size: 0.9rem; }

/* Features */
.features { padding: 4rem 2rem; max-width: 1100px; margin: 0 auto; }
.features h2, .pricing h2 { text-align: center; font-size: 2rem; margin-bottom: 2.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.feature-card { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Pricing */
.pricing { padding: 4rem 2rem; background: white; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; max-width: 900px; margin: 0 auto; }
.plan-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.price { font-size: 2.5rem; font-weight: 700; color: var(--primary); margin: 1rem 0; }
.price span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.plan-card ul { list-style: none; margin: 1rem 0; text-align: left; }
.plan-card ul li::before { content: "✓ "; color: var(--secondary); }
.plan-card ul li { margin: 0.4rem 0; font-size: 0.9rem; }

/* Footer */
footer { text-align: center; padding: 2rem; color: var(--text-muted); border-top: 1px solid var(--border); }
footer a { color: var(--primary); }

/* Buttons */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.65rem 1.5rem; border-radius: var(--radius); cursor: pointer; font-size: 1rem; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 0.65rem 1.5rem; border-radius: var(--radius); cursor: pointer; font-size: 1rem; text-decoration: none; display: inline-block; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; }
.btn-full { width: 100%; text-align: center; display: block; }
.btn-logout { background: none; color: var(--sidebar-text); border: 1px solid #334155; padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; width: 100%; }
.btn-logout:hover { background: #334155; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.auth-container { width: 100%; max-width: 460px; padding: 1rem; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand a { color: white; text-decoration: none; font-size: 1.8rem; font-weight: 700; }
.auth-card { background: white; border-radius: 12px; padding: 2rem; box-shadow: var(--shadow-md); }
.auth-tabs { display: flex; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.tab-btn { flex: 1; padding: 0.75rem; background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-form h2 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.error-msg { color: var(--danger); margin-top: 0.5rem; font-size: 0.875rem; min-height: 1.2rem; }
.terms-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }
.hidden { display: none !important; }

/* Sidebar layout */
.app-page { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; height: 100vh; }
.sidebar-brand { padding: 1.25rem 1.5rem; font-size: 1.1rem; font-weight: 700; color: white; border-bottom: 1px solid #334155; }
.sidebar-nav { list-style: none; padding: 1rem 0; flex: 1; overflow-y: auto; }
.sidebar-nav li { margin: 0; }
.sidebar-nav a { display: block; padding: 0.7rem 1.5rem; color: var(--sidebar-text); text-decoration: none; font-size: 0.95rem; border-left: 3px solid transparent; transition: all 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: white; background: rgba(37,99,235,0.15); border-left-color: var(--primary); }
.sidebar-footer { padding: 1rem; border-top: 1px solid #334155; }
.main-content { margin-left: 240px; padding: 2rem; flex: 1; min-height: 100vh; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.dashboard-card { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.dashboard-card h3 { margin-bottom: 1rem; }
.view-all { color: var(--primary); text-decoration: none; font-size: 0.875rem; }
.dashboard-actions { display: flex; gap: 1rem; }

/* Match items */
.match-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.match-item:last-child { border-bottom: none; }
.match-score { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.match-info strong { display: block; font-size: 0.9rem; }
.match-info span { font-size: 0.8rem; color: var(--text-muted); }

/* Badges */
.badge-STRONG_MATCH { background: #dcfce7; color: #16a34a; }
.badge-POSSIBLE_MATCH { background: #dbeafe; color: #2563eb; }
.badge-STRETCH_MATCH { background: #fef3c7; color: #d97706; }
.badge-LOW_MATCH { background: #f1f5f9; color: #64748b; }
.badge-NOT_ELIGIBLE { background: #fee2e2; color: #dc2626; }

/* Jobs grid */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.job-card { background: white; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.classification-STRONG_MATCH { border-left-color: #16a34a; }
.classification-POSSIBLE_MATCH { border-left-color: var(--primary); }
.classification-STRETCH_MATCH { border-left-color: var(--warning); }
.classification-NOT_ELIGIBLE { border-left-color: var(--danger); }
.job-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.score-badge { background: var(--primary); color: white; padding: 0.25rem 0.6rem; border-radius: 20px; font-weight: 700; font-size: 0.85rem; }
.classification-badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.job-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.job-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.job-recommendation { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin: 0.5rem 0; }
.job-actions { display: flex; gap: 0.5rem; margin-top: 1rem; align-items: center; }
.action-btn { background: var(--bg); border: 1px solid var(--border); padding: 0.4rem 0.75rem; border-radius: var(--radius); cursor: pointer; font-size: 1rem; }
.action-btn:hover { background: var(--border); }

/* Filter bar */
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-btn { background: white; border: 1px solid var(--border); padding: 0.4rem 1rem; border-radius: 20px; cursor: pointer; font-size: 0.875rem; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #16a34a; }
.alert-error { background: #fee2e2; color: #dc2626; }
.alert-warning { background: #fef3c7; color: #d97706; }

/* Status badges */
.status-badge { padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.status-draft { background: #f1f5f9; color: #64748b; }
.status-submitted { background: #dbeafe; color: #2563eb; }
.status-interviewing { background: #dcfce7; color: #16a34a; }
.status-rejected { background: #fee2e2; color: #dc2626; }
.status-offered { background: #d1fae5; color: #059669; }

/* Onboarding */
.onboarding-container { max-width: 600px; margin: 2rem auto; padding: 1rem; }
.onboarding-header { text-align: center; margin-bottom: 2rem; }
.step-indicators { display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.step { width: 36px; height: 36px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); }
.step.active { background: var(--primary); color: white; }
.step-line { width: 60px; height: 2px; background: var(--border); }
.onboarding-step { background: white; border-radius: 12px; padding: 2rem; box-shadow: var(--shadow-md); }
.onboarding-step h2 { margin-bottom: 0.5rem; }
.onboarding-step p { color: var(--text-muted); margin-bottom: 1.5rem; }
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.upload-area:hover { border-color: var(--primary); }
.upload-icon { font-size: 2.5rem; }
.checkbox-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.checkbox-group label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }

/* Spinner */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { color: var(--text-muted); font-style: italic; padding: 2rem; text-align: center; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Additional helpers */
.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.text-muted { color: #6b7280; font-size: 0.9em; }
.text-sm { font-size: 0.85em; }
.copy-box {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  font-family: monospace;
  white-space: pre-wrap;
  transition: border-color 0.2s;
}
.copy-box:hover { border-color: #6366f1; background: #f5f3ff; }
.cert-card { border-left: 4px solid #6366f1; }
.cert-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.cert-meta { display: flex; gap: 1.5rem; margin-top: 0.75rem; color: #6b7280; font-size: 0.9em; }
.badge { display: inline-block; padding: 0.2em 0.6em; background: #ede9fe; color: #5b21b6; border-radius: 9999px; font-size: 0.8em; margin: 0.1em; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; border-radius: 6px; padding: 0.75rem 1rem; }
.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 2px solid #e5e7eb; }
.tab-btn { padding: 0.5rem 1rem; background: none; border: none; cursor: pointer; color: #6b7280; font-size: 1rem; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }
.tab-content { }
.info-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1.5rem; color: #1e40af; }

/* ===== Auth & Onboarding improvements ===== */
.btn-full { width: 100%; display: block; text-align: center; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.auth-page { background: #f5f3ff; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { width: 100%; max-width: 460px; margin: 0 auto; padding: 1rem; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; font-weight: 700; }
.auth-brand a { color: #6366f1; text-decoration: none; }
.auth-card { background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 4px 24px rgba(99,102,241,0.12); }
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 2px solid #e5e7eb; }
.auth-tabs .tab-btn { flex: 1; padding: 0.6rem; background: none; border: none; cursor: pointer; font-size: 1rem; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tabs .tab-btn.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 700; }
.auth-form h2 { font-size: 1.3rem; margin-bottom: 1.2rem; }
.auth-form .form-group { margin-bottom: 1rem; }
.auth-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.auth-form input, .auth-form select { width: 100%; padding: 0.6rem 0.85rem; border: 1.5px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; box-sizing: border-box; }
.auth-form input:focus, .auth-form select:focus { outline: none; border-color: #6366f1; }
.error-msg { color: #dc2626; font-size: 0.87em; margin-top: 0.4rem; min-height: 1.2em; }
.terms-note { text-align: center; color: #6b7280; font-size: 0.82em; margin-top: 0.75rem; }
