/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: #1f2937; line-height: 1.6; min-height: 100vh; }

/* ── Auth page ────────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }
.auth-card { background: #fff; border-radius: 12px; padding: 48px 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-logo { font-size: 22px; font-weight: 800; color: #1e3a5f; margin-bottom: 8px; }
.auth-sub  { font-size: 14px; color: #6b7280; margin-bottom: 32px; }
.auth-card label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #374151; margin-bottom: 6px; }
.auth-card input[type=text], .auth-card input[type=password] {
  width: 100%; padding: 11px 14px; border: 1.5px solid #d1d5db; border-radius: 7px;
  font-size: 15px; margin-bottom: 20px; outline: none; transition: border-color .2s;
}
.auth-card input:focus { border-color: #1e3a5f; }
.btn-primary { display: block; width: 100%; padding: 13px; background: #1e3a5f; color: #fff; border: none; border-radius: 7px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s; }
.btn-primary:hover { background: #16304f; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 18px; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 240px; background: #0f172a; color: #e2e8f0; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { padding: 24px 20px 20px; font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.5px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo span { color: #60a5fa; }
.sidebar-user { padding: 16px 20px; font-size: 13px; color: #94a3b8; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-user strong { display: block; color: #f1f5f9; font-size: 15px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 14px; color: #94a3b8; text-decoration: none; transition: all .15s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { border-left: 3px solid #60a5fa; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer a { font-size: 13px; color: #64748b; text-decoration: none; }
.sidebar-footer a:hover { color: #94a3b8; }

/* Main content */
.main { flex: 1; overflow-x: hidden; }
.main-header { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 20px 32px; }
.main-header h1 { font-size: 22px; font-weight: 700; color: #111827; }
.main-header p  { font-size: 14px; color: #6b7280; margin-top: 2px; }
.main-body { padding: 32px; max-width: 960px; }

/* ── Cards & panels ───────────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 24px; margin-bottom: 24px; }
.card-title { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f3f4f6; }

/* File list */
.file-list { list-style: none; }
.file-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.file-list li:last-child { border-bottom: none; }
.file-name { font-weight: 500; color: #111827; }
.file-meta { font-size: 12px; color: #9ca3af; margin-left: 8px; }
.file-actions a { font-size: 12px; color: #dc2626; text-decoration: none; margin-left: 12px; }
.file-actions a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 32px; color: #9ca3af; font-size: 14px; }

/* Upload zone */
.upload-zone { border: 2px dashed #d1d5db; border-radius: 8px; padding: 20px; text-align: center; font-size: 14px; color: #6b7280; transition: border-color .2s; }
.upload-zone:hover { border-color: #1e3a5f; }
.upload-zone input[type=file] { margin-top: 10px; }

/* ── Form elements ────────────────────────────────────────────────────────── */
label.field-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #374151; margin-bottom: 6px; margin-top: 18px; }
label.field-label:first-child { margin-top: 0; }
select, textarea, input[type=text] {
  width: 100%; padding: 10px 13px; border: 1.5px solid #d1d5db; border-radius: 7px;
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .2s; background: #fff;
}
select:focus, textarea:focus, input[type=text]:focus { border-color: #1e3a5f; }
textarea { resize: vertical; min-height: 120px; }
.field-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.btn-submit { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; background: #1e3a5f; color: #fff; border: none; border-radius: 7px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s; margin-top: 24px; }
.btn-submit:hover { background: #16304f; }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s; }
.btn-secondary:hover { background: #e5e7eb; }

/* ── Progress / loading ───────────────────────────────────────────────────── */
.spinner-wrap { text-align: center; padding: 48px 0; display: none; }
.spinner { width: 44px; height: 44px; border: 4px solid #e5e7eb; border-top-color: #1e3a5f; border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-msg { font-size: 15px; color: #6b7280; }

/* ── Result panel ─────────────────────────────────────────────────────────── */
.result-panel { display: none; }
.ats-score-bar { background: #f3f4f6; border-radius: 8px; height: 12px; margin: 8px 0 4px; overflow: hidden; }
.ats-score-fill { height: 100%; background: linear-gradient(90deg, #1e3a5f, #3b82f6); border-radius: 8px; transition: width .8s ease; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-green  { background: #d1fae5; color: #065f46; }
.tag-blue   { background: #dbeafe; color: #1d4ed8; }
.tag-orange { background: #fef3c7; color: #92400e; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.download-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: #1e3a5f; color: #fff; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background .2s; }
.download-btn:hover { background: #16304f; }
.download-btn.outline { background: #fff; color: #1e3a5f; border: 2px solid #1e3a5f; }
.download-btn.outline:hover { background: #f0f6ff; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .sidebar { display: none; }
  .main-body { padding: 20px 16px; }
  .download-grid { grid-template-columns: 1fr; }
}
