:root {
  --accent: #C41230;
  --accent-light: #E13856;
  --secondary: #7A0C1F;
  --dark: #141414;
  --bg: #f7f5f5;
  --card-bg: #ffffff;
  --text: #1e1e1e;
  --muted: #6b6b6b;
  --border: #e7e1e1;
  --success: #1e8e5a;
  --error: #c0392b;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(20, 10, 10, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Calibri', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---------------------------------------------------------------- */
/* Topbar                                                            */
/* ---------------------------------------------------------------- */

.topbar {
  background: var(--dark);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--accent);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo-img { height: 30px; }
.topbar .brand { font-weight: 700; font-size: 1.2rem; letter-spacing: 0.3px; }
.topbar .tagline { font-size: 0.78rem; opacity: 0.75; margin-top: 1px; }

.btn-logout {
  background: transparent;
  color: #f0d9dd;
  border: 1.4px solid #5a3a40;
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-logout:hover { background: rgba(255,255,255,0.06); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- */
/* Hero                                                               */
/* ---------------------------------------------------------------- */

.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #2a0d14 60%, var(--secondary) 100%);
  color: #fff;
  padding: 56px 20px 80px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-title { font-size: 2.1rem; line-height: 1.28; margin: 0 0 16px; font-weight: 700; }
.hero-subtitle { font-size: 1.02rem; line-height: 1.55; color: #e6d3d6; margin: 0; }

/* ---------------------------------------------------------------- */
/* Container / Card                                                  */
/* ---------------------------------------------------------------- */

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 80px;
  position: relative;
}

/* Only the landing page's container sits directly below the colorful
   .hero banner and needs to overlap it — scoped separately so preview.html
   (which has no .hero above it) is never affected by this. */
.container.landing-container {
  margin-top: -46px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  border: 1px solid var(--border);
}
.upload-card { margin-bottom: 36px; }

h1.page-title { font-size: 1.6rem; margin: 0 0 6px; }
.subtitle { color: var(--muted); margin: 0 0 28px; font-size: 0.95rem; }

.dropzone {
  border: 2px dashed #d8c6c9;
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fdfafa;
  display: block;
}
.dropzone.dragover { border-color: var(--accent); background: #fdf0f2; }
.dropzone svg { color: var(--accent); margin-bottom: 10px; }
.dropzone .dz-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.dropzone .dz-sub { color: var(--muted); font-size: 0.85rem; }
.dropzone input[type="file"] { display: none; }

.file-chip {
  display: flex; align-items: center; gap: 10px;
  background: #fdf0f2; border-radius: 8px; padding: 10px 14px;
  margin-top: 18px; font-size: 0.9rem;
}
.file-chip .remove { margin-left: auto; cursor: pointer; color: var(--error); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 8px; padding: 12px 22px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:disabled { background: #cfa7ae; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-secondary:hover { background: #fdf0f2; }
.btn:active { transform: scale(0.98); }

.actions-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.progress-wrap { margin-top: 22px; display: none; }
.progress-bar-track {
  height: 8px; background: #ece4e5; border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.25s ease;
}
.progress-label { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }

.alert {
  border-radius: 8px; padding: 12px 16px; font-size: 0.88rem; margin-top: 18px;
  display: none;
}
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f4c6c0; }
.alert-warning { background: #fff8e6; color: #916300; border: 1px solid #f5e2a3; }

.supported-formats {
  margin-top: 26px; font-size: 0.8rem; color: var(--muted); text-align: center;
}

/* ---------------------------------------------------------------- */
/* Upload tabs (single / multi)                                      */
/* ---------------------------------------------------------------- */

.upload-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
}
.upload-tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 4px; margin-right: 22px;
  font-size: 0.95rem; font-weight: 600; color: var(--muted);
  border-bottom: 2.5px solid transparent;
  font-family: inherit;
}
.upload-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
  background: #f1e4e6; color: var(--secondary);
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  margin-left: 4px;
}

/* ---------------------------------------------------------------- */
/* Batch file list (before upload)                                   */
/* ---------------------------------------------------------------- */

.batch-file-list { margin-top: 16px; }
.batch-file-row {
  display: flex; align-items: center; gap: 10px;
  background: #fdf0f2; border-radius: 8px; padding: 9px 14px;
  margin-bottom: 8px; font-size: 0.88rem;
}
.batch-file-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-file-size { color: var(--muted); font-size: 0.8rem; }
.batch-file-remove { color: var(--error); font-weight: 700; cursor: pointer; font-size: 0.8rem; }

/* ---------------------------------------------------------------- */
/* Batch progress (during / after processing)                        */
/* ---------------------------------------------------------------- */

.batch-progress-header { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.batch-file-status-list { margin-top: 16px; }
.batch-status-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 0.87rem;
}
.batch-status-row:last-child { border-bottom: none; }
.batch-status-icon { width: 18px; text-align: center; font-weight: 700; }
.batch-status-row.ok .batch-status-icon { color: var(--success); }
.batch-status-row.err .batch-status-icon { color: var(--error); }
.batch-status-row.pending .batch-status-icon { color: var(--muted); }
.batch-status-name { font-weight: 600; flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-status-label { color: var(--muted); font-size: 0.82rem; }
.batch-status-error {
  flex-basis: 100%; color: var(--error); font-size: 0.78rem; margin-top: 2px; margin-left: 28px;
}

/* ---------------------------------------------------------------- */
/* How it works                                                      */
/* ---------------------------------------------------------------- */

.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hiw-step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.hiw-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; margin-bottom: 12px;
}
.hiw-title { font-weight: 700; margin-bottom: 6px; }
.hiw-text { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 720px) {
  .how-it-works { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------- */
/* Login page                                                        */
/* ---------------------------------------------------------------- */

.login-body {
  background: linear-gradient(135deg, var(--dark) 0%, #2a0d14 55%, var(--secondary) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-wrap { width: 100%; max-width: 380px; }
.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  padding: 36px 32px;
}
.login-brand { text-align: center; margin-bottom: 18px; }
.login-logo-img { height: 40px; }
.login-logo-text { font-weight: 700; letter-spacing: 1.5px; color: var(--accent); font-size: 1.1rem; }
.login-title { font-size: 1.4rem; margin: 6px 0 2px; text-align: center; }
.login-subtitle { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 0 0 24px; }

.field-label { display: block; font-size: 0.82rem; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
.field-input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  border: 1.4px solid var(--border); font-size: 0.95rem;
  font-family: inherit;
}
.field-input:focus { outline: none; border-color: var(--accent); }

.login-submit { width: 100%; margin-top: 22px; }

/* ---------------------------------------------------------------- */
/* Preview page                                                       */
/* ---------------------------------------------------------------- */

.preview-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.preview-toolbar .btn-group { display: flex; gap: 10px; }

.resume-sheet {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow);
  font-family: Calibri, 'Segoe UI', Arial, sans-serif;
  color: var(--dark);
  overflow: hidden;
}

.r-header-banner { padding: 22px 44px 16px; }
.r-header-row { display: flex; align-items: flex-end; justify-content: space-between; }
.r-header-spacer { width: 120px; flex-shrink: 0; }
.r-name { font-size: 30px; font-weight: 700; color: var(--dark); text-align: center; flex: 1; }
.r-logo-img { height: 44px; }
.r-logo-text { font-weight: 700; letter-spacing: 1.2px; color: #5a5a5a; font-size: 13px; }
.r-header-logo { width: 120px; flex-shrink: 0; text-align: right; }
.r-accent-rule { height: 3px; background: var(--accent); margin-top: 4px; }

.r-body { padding: 18px 44px 44px; }

.r-contact { font-size: 13px; color: #444; text-align: center; }
.r-contact .sep { color: var(--accent); font-weight: 700; }
.r-links { font-size: 12px; color: var(--secondary); text-align: center; margin-top: 3px; }
.r-links a { color: var(--secondary); text-decoration: none; }

.r-section { margin-top: 18px; }
.r-section h2 {
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); border-bottom: 1.6px solid var(--secondary);
  padding-bottom: 2px; margin: 0 0 6px; font-weight: 700;
}
.r-section h2 .heading-suffix {
  text-transform: none; font-weight: 400; font-style: italic;
  font-size: 11.5px; color: var(--secondary); letter-spacing: normal;
}

.r-entry { margin-bottom: 10px; }
.r-entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.r-entry-title { font-weight: 700; font-size: 14px; }
.r-entry-title a { color: var(--dark); text-decoration: underline; }
.r-entry-date { font-style: italic; color: var(--secondary); font-size: 12px; white-space: nowrap; font-weight: 600; }
.r-entry-sub { font-style: italic; color: #5a5a5a; font-size: 12.5px; margin: 2px 0 5px; }

.r-skill-group { font-size: 13px; line-height: 1.7; margin-bottom: 3px; }
.r-skill-group .r-skill-category { font-weight: 700; color: var(--dark); }

.resume-sheet ul { margin: 4px 0 0; padding-left: 20px; }
.resume-sheet li { margin-bottom: 3px; font-size: 13px; }
.resume-sheet li a { color: var(--secondary); }
.resume-sheet p.plain { margin: 3px 0; font-size: 13px; }

.loader {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 60px 0; color: var(--muted);
}
.spinner {
  width: 22px; height: 22px; border: 3px solid #ece0e2; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.warning-box {
  background: #fff8e6; border: 1px solid #f5e2a3; color: #916300;
  border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; margin-bottom: 20px;
}

/* ---------------------------------------------------------------- */
/* Compare view (original vs. standardized, single resume)           */
/* ---------------------------------------------------------------- */

.compare-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.compare-pane {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.compare-pane-label {
  font-weight: 700; font-size: 0.85rem; color: var(--dark);
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: #faf7f7;
}
.compare-frame {
  width: 100%; height: 78vh; border: none; display: block; background: #fff;
}

@media (max-width: 900px) {
  .compare-wrap { grid-template-columns: 1fr; }
  .compare-frame { height: 60vh; }
}

/* ---------------------------------------------------------------- */
/* Batch review grid                                                  */
/* ---------------------------------------------------------------- */

.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.grid-tile {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.grid-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20,10,10,0.12); }
.grid-tile-disabled { cursor: default; }
.grid-tile-disabled:hover { transform: none; box-shadow: var(--shadow); }

.grid-thumb {
  width: 100%; aspect-ratio: 210 / 297; background: #f3eeee;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.grid-thumb-error-border { background: #fdecea; }
.grid-thumb-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.grid-thumb-placeholder { color: var(--muted); font-size: 1.4rem; }
.grid-thumb-failed { color: var(--error); font-weight: 700; font-size: 1.6rem; }

.grid-tile-name {
  font-size: 0.82rem; font-weight: 600; padding: 10px 12px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid-tile-status {
  font-size: 0.75rem; padding: 0 12px 10px; font-weight: 600;
}
.grid-tile-status.ok { color: var(--success); }
.grid-tile-status.err { color: var(--error); }
.grid-tile-status.pending { color: var(--muted); }
.grid-tile-error {
  font-size: 0.72rem; color: var(--error); padding: 0 12px 10px; line-height: 1.4;
}