:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --brand-yellow: #ffc000;
  --brand-yellow-dark: #b98200;
  --brand-ink: #1f2937;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fffaf0;
  --muted: #667085;
  --border: #d8dee8;
  --danger: #dc2626;
  --info: #0369a1;
  --success: #15803d;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  padding: 18px;
  min-height: 100vh;
  background: linear-gradient(180deg, #fff7db 0, var(--bg) 300px);
  color: var(--brand-ink);
  line-height: 1.6;
}

.container {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 12px;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #111827;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 10px;
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.subtitle {
  max-width: 680px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--muted);
}

.brandHeader,
.sponsorFooter {
  display: flex;
  justify-content: center;
}

.brandHeader {
  margin-bottom: 20px;
}

.brandLogo {
  width: min(100%, 500px);
  height: auto;
}

.question-container {
  margin: 18px 0;
  padding: clamp(18px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.card {
  padding: 0;
  background: transparent;
  border-radius: 12px;
}

.formCard {
  margin-top: 8px;
}

.formSections {
  display: grid;
  gap: 20px;
}

.formSection {
  padding: clamp(18px, 3vw, 26px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.formSectionFinal {
  background: var(--surface-soft);
}

.sectionHeader {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 12px;
  margin-bottom: 20px;
  background: #fffdf4;
  border: 1px solid #f1d48a;
  border-radius: 10px;
}

.sectionNumber {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-yellow);
  color: var(--brand-ink);
  font-weight: 800;
}

.sectionHeader h2 {
  margin-bottom: 4px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.sectionHeader p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

label,
.fieldLabel {
  font-weight: 700;
  color: #1f2937;
}

label,
.interviewField {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: #111827;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus) {
  border-color: #aab4c4;
}

input::placeholder {
  color: #8a94a6;
}

input:focus,
select:focus,
.uploadZone:focus-within {
  outline: none;
  border-color: var(--brand-yellow-dark);
  box-shadow: 0 0 0 4px rgba(255, 192, 0, 0.28);
}

input:disabled,
select:disabled {
  background: #eef2f7;
  color: #667085;
  cursor: not-allowed;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
.errorField {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

button {
  min-height: 50px;
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-yellow);
  color: var(--brand-ink);
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms ease, box-shadow 150ms ease,
    transform 100ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:hover:not(:disabled) {
  background: var(--brand-yellow-dark);
}

button:focus-visible {
  outline: 4px solid rgba(255, 192, 0, 0.35);
  outline-offset: 2px;
}

button:disabled {
  background: #d1d5db;
  color: #667085;
  cursor: not-allowed;
}

.secondary {
  background: #ffffff;
  color: #7a5700;
  border: 2px solid var(--brand-yellow);
}

.secondary:hover:not(:disabled) {
  background: #fff8dc;
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.actions button {
  min-width: min(100%, 360px);
  min-height: 58px;
  font-size: 1.08rem;
}

.between {
  justify-content: space-between;
}

.checkboxRow {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 12px;
  min-height: 48px;
  margin-top: 14px;
  padding: 13px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
}

.checkboxRow input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 2px;
  accent-color: var(--brand-yellow);
}

.fullGridField {
  grid-column: 1 / -1;
}

.helpText {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.error {
  margin-top: 12px;
  padding: 10px 12px;
  color: #991b1b;
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  border-radius: 10px;
  font-weight: 700;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.summary div {
  padding: 10px;
  background: #fff8e1;
  border: 1px solid #f1d48a;
  border-radius: 8px;
}

.summary dt {
  color: #6b7280;
  font-size: 12px;
}

.summary dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.pdfInstructions,
.confirmacaoAviso {
  padding: 13px 15px;
  background: #fff8dc;
  border: 1px solid #f1d48a;
  border-left: 5px solid var(--brand-yellow);
  border-radius: 10px;
  color: #423407;
  font-weight: 600;
}

.pdfInstructions p,
.pdfInstructions ul {
  margin: 0 0 8px;
}

.pdfInstructions ul {
  padding-left: 20px;
}

.pdfInstructions li {
  margin-bottom: 6px;
}

.pdfInstructions p:last-child,
.pdfInstructions li:last-child {
  margin-bottom: 0;
}

.fileField {
  gap: 12px;
}

.uploadZone {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  color: #3b2f00;
  background: #fffdf4;
  border: 2px dashed #d6a300;
  border-radius: 12px;
  cursor: pointer;
}

.uploadZone {
  transition: background-color 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease;
}

.uploadZone:hover,
.uploadZone.dragActive {
  background: #fff6cf;
  border-color: var(--brand-yellow-dark);
}

.uploadZone.dragActive {
  box-shadow: 0 0 0 4px rgba(255, 192, 0, 0.28);
}

.uploadIcon {
  width: 46px;
  height: 46px;
  padding: 10px;
  color: #8a6400;
  background: #ffffff;
  border-radius: 12px;
}

.uploadZone strong,
.uploadZone small {
  display: block;
}

.uploadZone small {
  color: #66501c;
  font-weight: 600;
}

.fileInput {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.entrevistaPresencialAviso,
.slotPreview {
  padding: 13px 15px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #0ea5e9;
  border-radius: 10px;
  color: #0f3e5f;
  font-weight: 700;
}

.slotMuted {
  margin: 0;
  padding: 13px 15px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
}

.slotPicker {
  display: grid;
  gap: 10px;
}

.slotDayRow {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.slotDayRow.selected {
  border-color: #d6a300;
  background: #fffdf4;
}

.slotDaySummary {
  display: grid;
  grid-template-columns: 1fr auto 22px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.slotDaySummary::-webkit-details-marker {
  display: none;
}

.slotDaySummary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: rotate(45deg);
}

.slotDayRow[open] .slotDaySummary::after {
  transform: rotate(225deg);
}

.slotDaySummary:focus-visible {
  outline: 4px solid rgba(255, 192, 0, 0.35);
  outline-offset: -4px;
}

.slotDayLabel {
  min-width: 0;
  color: #1f2937;
  font-weight: 800;
}

.slotDayCount {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.slotTimeList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.slotTimeButton {
  min-width: 72px;
  min-height: 44px;
  padding: 9px 14px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: none;
}

.slotTimeButton:hover:not(:disabled) {
  background: #fff8dc;
}

.slotTimeButton.active {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-ink);
}

.slotSkeleton {
  display: grid;
  gap: 10px;
}

.slotSkeletonRow {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) 1fr;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  opacity: 0.65;
}

.slotSkeletonDay,
.slotSkeletonTimes {
  display: block;
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb, #f1f5f9, #e5e7eb);
}

.slotSkeletonTimes {
  min-height: 44px;
}

.slotPreview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.slotClearButton {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: #0f3e5f;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: none;
}

.slotClearButton:hover:not(:disabled) {
  background: #dbeafe;
}

.legalBox,
.schoolInfoBox,
.interviewChecklist {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.legalBox p,
.legalBox ul,
.schoolInfoBox p,
.interviewChecklist ul {
  margin: 0;
}

.legalBox p,
.interviewChecklist h3 {
  margin-bottom: 10px;
  font-weight: 800;
}

.legalBox ul,
.interviewChecklist ul {
  padding-left: 22px;
}

.legalBox li,
.interviewChecklist li {
  margin-bottom: 8px;
}

.cursosIndisponiveisAviso {
  display: grid;
  gap: 16px;
  padding: 15px 17px;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-left: 5px solid #ef4444;
  border-radius: 10px;
  color: #334155;
  font-weight: 600;
}

.courseNoticeGroup {
  margin-bottom: 0;
}

.courseNoticeTitle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.courseNoticeTitleDanger {
  color: #b91c1c;
}

.courseNoticeTitleInfo {
  color: var(--info);
}

.noticeIcon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.courseNoticeList {
  margin: 8px 0 0;
  padding-left: 28px;
}

.courseNoticeList li {
  margin-bottom: 10px;
}

.courseName {
  font-weight: 800;
}

.noticeItemAction {
  margin-top: 10px;
}

.courseSwitchAction {
  min-height: 48px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #2563eb;
  color: #1d4ed8;
  box-shadow: none;
}

.courseSwitchAction:hover:not(:disabled) {
  background: #dbeafe;
}

.confirmationCard {
  padding: clamp(20px, 4vw, 32px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.successHero {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.successCheck {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  color: var(--success);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.successHero h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
}

.successHero p,
.confirmationContent p {
  margin: 0 0 8px;
  color: #374151;
}

.confirmationContent {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.confirmationContact {
  margin-top: 16px;
  background: #fffdf4;
  border-color: #f1d48a;
}

.confirmationContact h3 {
  margin-bottom: 8px;
}

.printHint {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: #0f3e5f;
  background: #eef6ff;
  border-radius: 10px;
  font-weight: 700;
}

.farewellText {
  margin: 14px 0 0;
  font-weight: 800;
}

.sponsorFooter {
  margin-top: 22px;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.sponsorLogo {
  width: min(100%, 640px);
  height: auto;
}

.footerLocations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.footerLocationCard {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.footerLocationCard h3,
.footerLocationCard p {
  margin: 0 0 4px;
}

.footerLocationCard p {
  color: #3d3d3d;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.48);
}

.modalCard {
  width: min(100%, 460px);
  padding: 20px;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-left: 6px solid var(--danger);
  border-radius: 12px;
}

.modalCard h3 {
  margin-bottom: 8px;
  color: #991b1b;
  font-size: 1.15rem;
}

.modalCard p {
  margin: 0;
  color: #374151;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 6px;
  }

  .question-container,
  .formSection {
    padding: 16px 14px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .sectionHeader {
    grid-template-columns: 40px 1fr;
  }

  .sectionNumber {
    width: 40px;
    height: 40px;
  }

  input,
  select,
  button {
    font-size: 16px;
  }

  .uploadZone {
    grid-template-columns: 1fr;
    text-align: center;
    place-items: center;
  }

  .slotSkeletonRow {
    grid-template-columns: 1fr;
  }

  .slotDaySummary {
    grid-template-columns: 1fr 18px;
    gap: 8px;
  }

  .slotDayCount {
    grid-column: 1;
    grid-row: 2;
  }

  .slotDaySummary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: center;
  }

  .actions button,
  .courseSwitchAction,
  .modalActions button {
    width: 100%;
  }

  .footerLocations,
  .successHero {
    grid-template-columns: 1fr;
  }

  .successHero {
    text-align: center;
  }

  .successCheck {
    margin: 0 auto;
  }
}

@media print {
  body,
  .question-container,
  .confirmationCard {
    padding: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .brandHeader,
  .sponsorFooter,
  .printHint {
    display: none;
  }
}

/* ============================================================
   Cabeçalho: etiqueta oficial e nota de campos obrigatórios
   ============================================================ */
.formEyebrow {
  display: table;
  margin: 0 auto 12px;
  padding: 5px 14px;
  background: #fff8dc;
  border: 1px solid #f1d48a;
  border-radius: 999px;
  color: #7a5700;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.requiredNote {
  max-width: 680px;
  margin: -16px auto 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ============================================================
   Chip de ficheiro selecionado (upload PDF)
   ============================================================ */
.fileSelectedChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: var(--success);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fileSelectedChip svg {
  flex-shrink: 0;
}

/* ============================================================
   Aviso de ausência de horários de entrevista
   ============================================================ */
.slotEmptyNotice {
  margin: 0;
  padding: 13px 15px;
  background: #fff8dc;
  border: 1px solid #f1d48a;
  border-left: 5px solid var(--brand-yellow);
  border-radius: 10px;
  color: #7a5700;
  font-weight: 700;
}

/* ============================================================
   Spinner do botão de submissão
   ============================================================ */
@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}

.btnSpinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 3px solid rgba(31, 41, 55, 0.25);
  border-top-color: var(--brand-ink);
  border-radius: 50%;
  animation: btnSpin 0.8s linear infinite;
}

/* ============================================================
   Entrada suave do modal de erro
   ============================================================ */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modalCard {
  animation: modalIn 180ms ease-out;
}

/* ============================================================
   Acessibilidade: respeitar preferência de movimento reduzido
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

