/* ================================================================
   main.css — Edaith Assessment Interface

   Colour palette (from brief):
     #006d77  teal     — progress bar, active states, buttons
     #fcfad9  beige    — section backgrounds
     #e0e0e0  grey     — page background
     #0a0a0a  black    — text, primary buttons (from email handler)

   Font: Helvetica Neue (matches PDF reports)
   Buttons: sharp edges (no border-radius), black fill, white text
   ================================================================ */

/* ── Reset and base ──────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #fcfcfc;
  color: #0a0a0a;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #006d77;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Site header ─────────────────────────────────────────────── */

.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #d0d0d0;
  padding: 16px 24px;
}

.site-header__logo-link {
  display: inline-block;
}

.site-header__logo {
  height: 48px;
  width: auto;
  display: block;
}

/* ── Progress bar ────────────────────────────────────────────── */

.progress-wrapper {
  background-color: #ffffff;
  border-bottom: 1px solid #d0d0d0;
  padding: 12px 24px 10px;
}

.progress-bar-track {
  height: 4px;
  background-color: #d0d0d0;
  border-radius: 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #006d77;
  transition: width 0.35s ease;
}

.progress-label {
  margin-top: 8px;
  font-size: 12px;
  color: #555;
  letter-spacing: 0.02em;
}

/* ── Main content area ───────────────────────────────────────── */

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── Screens ─────────────────────────────────────────────────── */

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen {
  width: 100%;
  animation: screenFadeIn 0.6s ease;
}

.screen__title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #0a0a0a;
}

.screen__title--group {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  letter-spacing: 0.03em;
  padding-bottom: 16px;
  border-bottom: 2px solid #0a0a0a;
  margin-bottom: 32px;
}

.screen__description {
  font-size: 14px;
  color: #555;
  margin-bottom: 36px;
  letter-spacing: 0.01em;
}

.screen__intro {
  font-size: 14px;
  font-weight: 400;
  color: #333;
  margin-bottom: 32px;
  max-width: 560px;
}

.screen__intro--confirmation {
  font-size: 18px;
  color: #0a0a0a;
}

/* ── Loading state ───────────────────────────────────────────── */

.screen--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading-text {
  color: #888;
  font-size: 14px;
}

/* ── Field groups ────────────────────────────────────────────── */

.fieldset,
.field-group {
  margin-bottom: 28px;
}

.field__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: #0a0a0a;
}

.field__hint {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.5;
}

.field__input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #fff;
  color: #0a0a0a;
  outline: none;
  transition: border-color 0.15s;
}

.field__input:focus {
  border-color: #006d77;
  box-shadow: 0 0 0 2px rgba(0, 109, 119, 0.15);
}

.field__input--code {
  font-size: 20px;
  letter-spacing: 0.15em;
  font-weight: 400;
  max-width: 260px;
  text-transform: uppercase;
}

.field__required {
  color: #c0392b;
}

.field__optional {
  color: #888;
  font-weight: 400;
}

.field__error {
  margin-top: 8px;
  font-size: 13px;
  color: #c0392b;
  line-height: 1.4;
}

.field__error--hidden {
  display: none;
}

/* ── Competency sections ─────────────────────────────────────── */

.competency {
  margin-bottom: 44px;
}

.competency__name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #006d77;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #c8c8c8;
}

.competency__description {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.55;
  color: #444;
  margin-bottom: 20px;
}

/* ── Question ────────────────────────────────────────────────── */

.question {
  margin-bottom: 36px;
  padding: 24px;
  background-color: #ffffff;
  border: 1px solid #d0d0d0;
}

.question--error {
  border-color: #c0392b;
}

.question__text {
  font-size: 14px;
  line-height: 1.55;
  color: #0a0a0a;
  margin-bottom: 24px;
}

/* ── Scale interaction ───────────────────────────────────────── */

.question__scale {
  margin-top: 4px;
}

.question__scale-controls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.question__anchor {
  font-size: 13px;
  color: #555;
  line-height: 1.3;
  flex-shrink: 0;
  max-width: 80px;
  padding-top: 10px; /* Align with button row */
}

.question__anchor--low {
  text-align: right;
}

.question__anchor--high {
  text-align: left;
}

.question__buttons {
  display: flex;
  gap: 4px;
}

.question__btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 2px solid #0a0a0a;
  background: #fff;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.1s, color 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0;
}

.question__btn:hover {
  background-color: #f0f0f0;
}

.question__btn--selected {
  background-color: #0a0a0a;
  color: #ffffff;
}

.question__btn:focus-visible {
  outline: 3px solid #006d77;
  outline-offset: 2px;
}

.question__error {
  margin-top: 12px;
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
}

/* ── Single-choice options ───────────────────────────────────── */

.question__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #0a0a0a;
  background: #ffffff;
  border: 2px solid #c8c8c8;
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.1s, background-color 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.question__option:hover {
  border-color: #006d77;
  background-color: #f5fefe;
}

.question__option--selected {
  border-color: #006d77;
  background-color: #e6f4f5;
  font-weight: 600;
  color: #006d77;
}

.question__option:focus-visible {
  outline: 3px solid #006d77;
  outline-offset: 2px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid #0a0a0a;
  border-radius: 0;
  transition: background-color 0.15s, color 0.15s;
  text-align: center;
}

.btn--primary {
  background-color: #0a0a0a;
  color: #ffffff;
}

.btn--primary:hover:not(:disabled) {
  background-color: #333;
}

.btn--primary:disabled {
  background-color: #aaa;
  border-color: #aaa;
  cursor: not-allowed;
}

.btn--secondary {
  background-color: transparent;
  color: #0a0a0a;
}

.btn--secondary:hover {
  background-color: #0a0a0a;
  color: #ffffff;
}

.btn--small {
  padding: 6px 14px;
  font-size: 12px;
  background-color: transparent;
  color: #0a0a0a;
}

.btn--small:hover {
  background-color: #0a0a0a;
  color: #ffffff;
}

/* ── Navigation ──────────────────────────────────────────────── */

.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #ccc;
}

/* ── Review screen ───────────────────────────────────────────── */

.nav--review .btn {
  min-width: 140px;
}

.review-table {
  margin-bottom: 32px;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #ccc;
}

.review-row__name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.review-row__status {
  font-size: 13px;
  font-weight: 600;
}

.review-row__status--done {
  color: #006d77;
}

.review-row__status--incomplete {
  color: #c0392b;
}

.review-warning {
  background-color: #fff3cd;
  border: 1px solid #e8c84a;
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 24px;
  color: #7a5c00;
}

.submit-error {
  color: #c0392b;
  font-size: 13px;
  width: 100%;
}

/* ── Confirmation screen ─────────────────────────────────────── */

.screen--confirmation {
  max-width: 100%;
}

@keyframes coverFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirmation__cover {
  display: block;
  max-width: 560px;
  width: 100%;
  margin: 24px 0 32px;
  animation: coverFadeIn 1.2s ease 0.5s both;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ── Site footer ─────────────────────────────────────────────── */

.site-footer {
  background-color: #ffffff;
  border-top: 1px solid #d0d0d0;
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: #666;
}

.site-footer p {
  margin-bottom: 4px;
}

.site-footer a {
  color: #0000EE;
}

/* ── Mobile responsive ───────────────────────────────────────── */

@media (max-width: 600px) {
  .main {
    padding: 24px 16px 48px;
  }

  .screen__title {
    font-size: 22px;
  }

  .question {
    padding: 18px 16px;
  }

  .question__text {
    font-size: 14px;
  }

  .question__scale-controls {
    flex-direction: column;
    gap: 8px;
  }

  .question__anchor {
    max-width: none;
    padding-top: 0;
    font-size: 11px;
    text-align: left;
  }

  .question__anchor--low {
    order: 1;
    text-align: left;
  }

  .question__buttons {
    order: 2;
    gap: 3px;
  }

  .question__btn {
    width: 36px;
    height: 36px;
  }

  .question__anchor--high {
    order: 3;
    text-align: left;
  }

  .question__btn {
    font-size: 13px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .review-row {
    flex-wrap: wrap;
  }

  .review-row__name {
    width: 100%;
    flex: none;
  }

  .site-header__logo {
    height: 28px;
  }
}

/* ── Print (not expected but safe) ──────────────────────────── */

@media print {
  .site-header, .site-footer, .progress-wrapper, .nav { display: none; }
}
