/* MSP Entry Form — Styles */
:root {
  --navy: #1a2744;
  --navy-light: #2c4a7c;
  --gold: #b8860b;
  --gold-light: #d4a843;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #2d3748;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Password Gate ── */
.gate {
  position: fixed; inset: 0; z-index: 1000;
  background: #FAFAF9;
  display: flex; align-items: center; justify-content: center;
}
.gate__box {
  background: #fff;
  border: 1px solid #E2E2E2;
  border-radius: 10px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px; width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}
.gate__logos { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 auto 24px; }
.gate__logo-img { height: 44px; width: auto; }
.gate__logo-img--exeurion { height: 18px; }
.gate__logo-divider { width: 1px; height: 36px; background: #E2E2E2; }
.gate__title { color: #00205B; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.gate__hint { color: #6B6B6B; font-size: 13px; margin-bottom: 24px; line-height: 1.5; }
.gate__input {
  width: 100%; padding: 12px 16px; border: 1px solid #E2E2E2;
  border-radius: 6px; background: #fff;
  color: #2d3748; font-size: 15px; text-align: center;
  outline: none; margin-bottom: 16px; letter-spacing: 0.08em;
}
.gate__input::placeholder { color: #aaa; }
.gate__input:focus { border-color: #00205B; }
.gate__btn {
  width: 100%; padding: 12px; border: none; border-radius: 6px;
  background: #00205B; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; letter-spacing: 0.5px;
}
.gate__btn:hover { background: #1A3A7A; }
.gate__error { color: #ef4444; font-size: 13px; margin-top: 12px; min-height: 20px; }
.gate--hidden { display: none !important; }

/* ── Header ── */
.header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 16px 24px; position: sticky; top: 0; z-index: 100;
}
.header__inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.header__brand { display: flex; align-items: center; gap: 16px; }
.header__logo { height: 68px; width: auto; }
.header__divider { width: 1px; height: 20px; background: var(--border); }
.header__title { font-size: 14px; font-weight: 600; color: var(--navy); }
.header__badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 4px; background: var(--gold); color: #fff;
  letter-spacing: 0.5px;
}

/* ── Progress ── */
.progress {
  max-width: 1080px; margin: 0 auto; padding: 24px 24px 0;
}
.progress__bar {
  display: flex; gap: 4px; margin-bottom: 8px;
}
.progress__segment {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border);
  transition: background 0.3s;
}
.progress__segment--active { background: var(--navy); }
.progress__segment--done { background: var(--green); }
.progress__labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-light); letter-spacing: 0.5px;
}
.progress__label--active { color: var(--navy); font-weight: 600; }

/* ── Main ── */
.main {
  max-width: 1080px; margin: 0 auto; padding: 24px;
}
.step { display: none; }
.step--active { display: block; }

/* ── Form Cards ── */
.form-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px;
}
.form-card__title {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* ── Form Fields ── */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.field__required { color: var(--red); margin-left: 2px; }
.field__hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff;
  outline: none; transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { cursor: pointer; }
.field--error input, .field--error select, .field--error textarea {
  border-color: var(--red);
}
.field__error {
  font-size: 12px; color: var(--red); margin-top: 4px;
  display: none;
}
.field--error .field__error { display: block; }

/* Grid layout for form fields */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .field--full { grid-column: 1 / -1; }

/* ── Section Scoring ── */
.section-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px;
  overflow: hidden;
}
.section-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: #f9fafb;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.section-card__name {
  font-size: 14px; font-weight: 700; color: var(--navy);
}
.section-card__score {
  display: flex; align-items: center; gap: 12px;
}
.section-card__score-text {
  font-size: 13px; font-weight: 600; color: var(--navy);
}
.section-card__pct {
  font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; color: #fff;
}
.section-card__pct--high { background: var(--green); }
.section-card__pct--mid { background: var(--gold); }
.section-card__pct--low { background: var(--red); }
.section-card__body { padding: 0; }

/* Questions */
.question-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 24px; border-bottom: 1px solid #f3f4f6;
  gap: 16px;
}
.question-row:last-of-type { border-bottom: none; }
.question-row__text {
  font-size: 13px; color: var(--text); line-height: 1.5;
  flex: 1;
}
.question-row__controls {
  display: flex; gap: 8px; flex-shrink: 0; align-items: center;
}
.question-row__hint {
  font-size: 11px; color: var(--text-light); margin-top: 2px;
  font-style: italic;
}

/* Radio buttons styled as toggle pills */
.score-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--text-light);
  transition: all 0.15s;
}
.score-btn:hover { border-color: var(--navy-light); color: var(--navy); }
.score-btn--selected {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.score-btn--yes.score-btn--selected { background: var(--green); border-color: var(--green); }
.score-btn--no.score-btn--selected { background: var(--red); border-color: var(--red); }

/* Text answer input in question row */
.question-row__text-input {
  width: 200px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit;
}
.question-row__text-input:focus { border-color: var(--navy); outline: none; }

/* Observation textarea */
.observation-area {
  margin: 0; padding: 16px 24px;
  border-top: 2px solid var(--border); background: #fafbfc;
}
.observation-area__label {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.observation-area textarea {
  width: 100%; padding: 10px 14px; min-height: 80px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; resize: vertical;
}
.observation-area textarea:focus { border-color: var(--navy); outline: none; }

/* ── Photo Upload ── */
.photo-upload {
  background: var(--card); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 32px;
  text-align: center; cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.photo-upload:hover { border-color: var(--navy); }
.photo-upload__icon { font-size: 32px; margin-bottom: 8px; }
.photo-upload__text { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.photo-upload__hint { font-size: 12px; color: var(--text-light); }
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.photo-thumb {
  position: relative; border-radius: 6px; overflow: hidden;
  aspect-ratio: 1; border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb__remove {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.photo-thumb__section {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 10px; padding: 2px 6px; text-align: center;
}

/* ── Review Page ── */
.review-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px; margin-bottom: 16px;
}
.review-card__title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin-bottom: 16px; display: flex; align-items: center;
  justify-content: space-between;
}
.review-card__edit {
  font-size: 12px; color: var(--blue); cursor: pointer;
  font-weight: 500; text-decoration: none;
}
.review-card__edit:hover { text-decoration: underline; }
.review-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.review-item__label {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
}
.review-item__value {
  font-size: 14px; font-weight: 500; color: var(--navy);
}

/* Overall score badge */
.overall-score {
  text-align: center; padding: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  border-radius: var(--radius); color: #fff; margin-bottom: 16px;
}
.overall-score__value { font-size: 48px; font-weight: 800; }
.overall-score__meta { font-size: 13px; opacity: 0.7; }

/* Review section details */
.review-section {
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 8px; overflow: hidden;
}
.review-section__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #f9fafb; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--navy);
}
.review-section__body {
  display: none; padding: 12px 16px; font-size: 12px;
  border-top: 1px solid var(--border);
}
.review-section--open .review-section__body { display: block; }
.review-q { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
.review-q:last-child { border-bottom: none; }
.review-q__score { font-weight: 600; }
.review-obs { margin-top: 8px; padding: 8px 12px; background: #f0f4f8; border-radius: 4px; font-style: italic; color: var(--text-light); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-light); }
.btn--secondary { background: #f1f5f9; color: var(--text); }
.btn--secondary:hover { background: #e2e8f0; }
.btn--success { background: var(--green); color: #fff; }
.btn--success:hover { background: #059669; }
.btn--danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-group {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0; margin-top: 8px;
}

/* ── Success Screen ── */
.success-screen {
  text-align: center; padding: 80px 24px;
}
.success-screen__icon { font-size: 64px; margin-bottom: 16px; }
.success-screen__title { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.success-screen__text { font-size: 14px; color: var(--text-light); margin-bottom: 32px; }

/* ── Footer ── */
.footer {
  background: var(--card); border-top: 1px solid var(--border);
  padding: 24px; margin-top: 40px;
}
.footer__inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer__legal { font-size: 11px; color: var(--text-light); max-width: 640px; }
.footer__logo { height: 28px; width: auto; opacity: 0.6; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .field-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .header__title { font-size: 12px; }
  .form-card { padding: 20px; }
  .question-row { flex-direction: column; gap: 8px; }
  .question-row__controls { align-self: flex-start; }
  .question-row__text-input { width: 100%; }
  .footer__inner { flex-direction: column; gap: 12px; text-align: center; }
}

/* ── Print ── */
/* ── Language Toggle ── */
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.lang-toggle button {
  padding: 8px 18px; border: none; background: transparent; font-size: 13px;
  font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.2s;
  min-width: 44px;
}
.lang-toggle button.active { background: var(--navy); color: #fff; }
.lang-toggle button:hover:not(.active) { background: #f1f5f9; }
.gate__lang { margin-bottom: 20px; }
.gate__lang .lang-toggle { border-color: #E2E2E2; }
.gate__lang .lang-toggle button { background: transparent; color: #6B6B6B; }
.gate__lang .lang-toggle button.active { background: #00205B; color: #fff; }

@media print {
  .header, .progress, .btn-group, .footer, .gate { display: none !important; }
  .step { display: block !important; }
  .section-card { break-inside: avoid; }
}
