/* ============================================================
   ForeroTeam Pre-Screening — shared styles
   Light: white bg / black text / red accent
   Dark:  black bg / white text / red accent
   ============================================================ */

:root {
  --red: #d11a1a;
  --red-dark: #a31313;
  --red-soft: rgba(209, 26, 26, 0.12);
  --yellow: #e0a500;
  --yellow-soft: rgba(224, 165, 0, 0.15);
  --green: #1f8a3a;

  --bg: #ffffff;
  --text: #111111;
  --text-muted: #5a5a5a;
  --border: #e4e4e4;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --input-bg: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
}

[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --text-muted: #b8b8b8;
  --border: #2a2a2a;
  --surface: #0e0e0e;
  --surface-2: #161616;
  --input-bg: #141414;
  --shadow: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom-on-focus */
}
a { color: var(--red); }

/* ============================================================
   TOGGLE BAR (top of every page)
   ============================================================ */
.toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.toggle-bar .brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.toggle-bar .toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-btn {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.lang-btn.active {
  background: var(--red);
  color: #fff;
}

/* ============================================================
   BANNER (red, on every applicant stage)
   ============================================================ */
.banner {
  background: var(--red);
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  font-weight: 500;
}

/* ============================================================
   FORM (index.html) — mobile-first
   ============================================================ */
.form-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px;
}

.progress {
  height: 8px;
  width: 100%;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 6px;
}
.progress-bar {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 240ms ease;
}
.progress-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stage h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.field {
  margin-bottom: 14px;
}
.field > label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text);
}

.text-input,
.select-input,
.textarea-input {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
}
.textarea-input {
  resize: vertical;
  min-height: 90px;
}
.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  outline: 2px solid var(--red);
  outline-offset: -1px;
  border-color: var(--red);
}

/* Yes/No segmented control */
.yesno {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}
.yesno button {
  flex: 1;
  background: var(--input-bg);
  color: var(--text);
  border: none;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
}
.yesno button.active {
  background: var(--red);
  color: #fff;
}

.info-msg {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--red);
}

.nav-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 18px;
}
.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Thank you / duplicate screens */
.full-msg {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.full-msg-card {
  max-width: 480px;
}
.full-msg h1 {
  color: var(--red);
  margin: 0 0 12px;
  font-size: 28px;
}
.full-msg p {
  font-size: 16px;
  line-height: 1.5;
}

/* ============================================================
   ADMIN (admin.html) — desktop-optimized
   ============================================================ */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.admin-header .brand {
  font-weight: 800;
  font-size: 18px;
}
.admin-header .right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-wrap {
  padding: 16px 20px 80px;
  max-width: 1600px;
  margin: 0 auto;
}

.zone-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}
.zone-filter button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}
.zone-filter button.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kanban { grid-template-columns: 1fr; }
}

.column {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 200px;
}
.column h3 {
  margin: 4px 4px 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.column h3 .count {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.column.drag-over {
  outline: 2px dashed var(--red);
  outline-offset: -4px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: var(--shadow);
}
.card.dragging { opacity: 0.5; }
.card .name { font-weight: 700; }
.card .meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card .badges {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}
.badge-red { background: var(--red); color: #fff; }
.badge-yellow { background: var(--yellow); color: #111; }
.badge-pass { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.badge-dup { background: #444; color: #fff; }

/* Login */
.login-wrap {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.login-card h2 {
  margin: 0 0 16px;
  color: var(--red);
}

/* Slide-out detail panel */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 80;
}
.panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(540px, 96vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 240ms ease;
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.detail-panel.open { transform: translateX(0); }
.detail-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.detail-head h2 { margin: 0; font-size: 18px; }
.detail-head .close-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
}
.detail-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
}
.detail-section {
  margin-bottom: 18px;
}
.detail-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.qa-row {
  margin: 8px 0;
}
.qa-row .q {
  font-size: 13px;
  color: var(--text-muted);
}
.qa-row .a {
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.flag-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.flag-list li {
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.flag-list li.red {
  background: var(--red-soft);
  border-left: 4px solid var(--red);
}
.flag-list li.yellow {
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.notes-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 14px;
}
.notes-list li .ts {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.detail-actions {
  border-top: 1px solid var(--border);
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.detail-actions .btn { padding: 10px 12px; font-size: 14px; }
.detail-actions .btn-approve { background: var(--green); color: #fff; }
.detail-actions .btn-reject { background: #555; color: #fff; }

.empty-col {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 6px;
}

.hidden { display: none !important; }
