/* ========================================
   GRUNDLAYOUT
======================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;

  background: #f4f6f8;
  color: #202124;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 17px;
  line-height: 1.6;
}


/* ========================================
   HAUPTBEREICH
======================================== */

.study-container {
  width: min(100% - 32px, 1000px);

  margin: 0 auto;

  padding: 40px 0 80px;
}


/* ========================================
   HEADINGS
======================================== */

h1 {
  margin-top: 0;

  font-size: 2.4rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.7rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
}


/* ========================================
   EINSTIEG
======================================== */

.intro-card {
  background: white;

  border: 1px solid #d9dee3;
  border-radius: 14px;

  padding: 32px;
  margin-bottom: 32px;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05);
}

.intro-card h1 {
  margin-bottom: 20px;
}

.important-information {
  margin-top: 28px;

  padding: 20px;

  border-left: 5px solid #333;

  background: #f1f3f4;
}

.important-information h3 {
  margin-top: 0;
}


/* ========================================
   PERSONENANGABEN
======================================== */

.participant-section {
  margin-top: 30px;

  padding-top: 24px;

  border-top: 1px solid #ddd;
}

.participant-section label {
  display: block;

  margin-bottom: 8px;
}

.participant-section input {
  width: 100%;
  max-width: 350px;

  padding: 12px 14px;

  font-size: 17px;

  border: 2px solid #777;
  border-radius: 8px;

  background: white;
}

.input-help {
  margin-top: 6px;

  font-size: 0.9rem;
  color: #555;
}


/* ========================================
   ALTER / SEHSTATUS
======================================== */

.demographic-fieldset {
  margin-top: 24px;
  margin-bottom: 24px;

  padding: 20px;

  border: 1px solid #c7ccd1;
  border-radius: 10px;

  background: #fafafa;
}

.demographic-fieldset legend {
  padding: 0 8px;

  font-size: 1.05rem;
}


/* ========================================
   SZENARIO-KARTEN
======================================== */

.scenario-card,
.final-test-card,
.final-feedback {
  background: white;

  border: 1px solid #d9dee3;
  border-radius: 14px;

  padding: 28px;

  margin-bottom: 32px;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05);
}


/* Scenario heading */

.scenario-title {
  margin-top: 0;

  padding-bottom: 18px;

  border-bottom: 2px solid #e5e7eb;
}


/* Subheading */

.scenario-subtitle {
  margin-top: 30px;
  margin-bottom: 14px;
}

.scenario-audio h3 {
  margin-top: 22px;
}


/* ========================================
   AUDIO-BUTTONS
======================================== */

.audio-buttons {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;

  margin-bottom: 20px;
}

.audio-button {
  min-height: 58px;

  padding: 13px 18px;

  background: #ffffff;
  color: #111111;

  border: 2px solid #444;
  border-radius: 9px;

  cursor: pointer;

  font-size: 16px;
  font-weight: 600;

  text-align: left;

  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

.audio-button:hover {
  background: #f0f0f0;
}

.audio-button:active {
  transform: translateY(1px);
}


/* ========================================
   SOUND MATCHING
======================================== */

.sound-matching-questions {
  display: grid;
  gap: 12px;

  margin-top: 24px;
  padding: 18px;

  border: 1px solid #c7ccd1;
  border-radius: 10px;
  background: #fafafa;
}

.sound-matching-hint {
  margin: 20px 0 0;
  padding: 10px 14px;

  border-left: 4px solid #444;
  background: #f1f3f4;
  color: #3c4043;

  font-size: 0.95rem;
}

.sound-matching-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 12px 14px;

  border: 1px solid #d9dee3;
  border-radius: 8px;
  background: #ffffff;
}

.sound-matching-row label {
  font-weight: 700;
}

.sound-matching-select {
  min-width: 160px;
  padding: 10px 12px;

  border: 2px solid #777;
  border-radius: 8px;
  background: #ffffff;
  color: #202124;

  font: inherit;
}


/* ========================================
   KEYBOARD / SCREEN-READER FOCUS
======================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 4px solid #005fcc;

  outline-offset: 3px;
}


/* ========================================
   BEOBACHTUNGSFELD
======================================== */

.observation-box {
  margin-top: 24px;

  padding: 20px;

  background: #f8f9fa;

  border: 1px solid #d0d5da;
  border-radius: 10px;
}

.observation-box label {
  display: block;

  margin-bottom: 10px;

  font-weight: 700;
}

.observation-box textarea {
  display: block;

  width: 100%;

  min-height: 110px;

  padding: 13px;

  font-family: inherit;

  font-size: 16px;

  line-height: 1.5;

  border: 2px solid #777;
  border-radius: 8px;

  resize: vertical;

  background: white;
}


/* ========================================
   BEWERTUNG
======================================== */

.scenario-feedback {
  margin-top: 32px;

  padding-top: 28px;

  border-top: 3px solid #e5e7eb;
}

.scenario-feedback h3 {
  margin-top: 0;

  font-size: 1.4rem;
}

.scenario-feedback fieldset {
  margin: 0 0 26px;

  padding: 18px;

  border: 1px solid #c7ccd1;
  border-radius: 10px;

  background: #fafafa;
}

.scenario-feedback legend {
  padding: 0 8px;

  font-weight: 700;
  font-size: 1.05rem;
}


/* ========================================
   RADIO BUTTONS
======================================== */

.radio-option {
  display: flex;

  align-items: flex-start;

  gap: 12px;

  padding: 9px 0;
}

.radio-option input {
  width: 20px;
  height: 20px;

  flex-shrink: 0;

  margin-top: 4px;
}

.radio-option label {
  cursor: pointer;

  line-height: 1.5;
}


/* ========================================
   TEXTFELDER SZENARIEN
======================================== */

.scenario-feedback > label {
  display: block;

  margin-bottom: 9px;

  font-weight: 700;
}

.scenario-feedback textarea {
  display: block;

  width: 100%;

  min-height: 120px;

  padding: 13px;

  font-family: inherit;

  font-size: 16px;

  line-height: 1.5;

  border: 2px solid #777;
  border-radius: 8px;

  resize: vertical;

  background: white;
}


/* ========================================
   SPEICHERN
======================================== */

.save-button {
  display: block;

  margin-top: 24px;

  padding: 14px 22px;

  border: 2px solid #111;
  border-radius: 9px;

  background: #111;
  color: white;

  font-size: 16px;
  font-weight: 700;

  cursor: pointer;
}

.save-button:hover {
  background: #333;
}

.save-button:disabled {
  background: #4b7f52;

  border-color: #4b7f52;

  cursor: default;
}

.save-success {
  margin-top: 15px;

  font-weight: 700;

  color: #286b35;
}


/* ========================================
   FINALE TESTS
======================================== */

.final-tests {
  margin-top: 40px;
}


/*
   Final Test Karten verwenden exakt
   denselben Stil wie Szenario-Karten.
*/

.final-test-card {
  margin-bottom: 32px;
}


/* Beschreibung innerhalb der Final Tests */

.final-test-card p {
  margin-bottom: 20px;
}


/* Start-Button */

.final-button {
  margin-top: 5px;
}


/* ========================================
   TEXTFELDER DER FINAL TESTS
======================================== */

.final-observation {
  margin-top: 24px;

  padding-top: 20px;

  border-top: 1px solid #d9dee3;
}

.final-observation label {
  display: block;

  margin-bottom: 10px;

  font-weight: 700;
}

.final-observation textarea {
  display: block;

  width: 100%;

  min-height: 130px;

  padding: 13px;

  font-family: inherit;

  font-size: 16px;

  line-height: 1.5;

  border: 2px solid #777;
  border-radius: 8px;

  resize: vertical;

  background: white;
}


/* ========================================
   AUSWERTUNG: FINAL TEST 1
======================================== */

.final-evaluation {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #d9dee3;
}

.final-evaluation h4 {
  margin: 0 0 16px;
}

.evaluation-table-wrapper {
  overflow-x: auto;
}

.evaluation-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
}

.evaluation-table th,
.evaluation-table td {
  padding: 12px 10px;
  border: 1px solid #d9dee3;
  text-align: center;
  vertical-align: middle;
}

.evaluation-table thead th {
  background: #f2f4f6;
  font-size: 0.9rem;
}

.evaluation-table th:first-child {
  width: 34%;
  text-align: left;
}

.evaluation-table tbody th {
  font-weight: 600;
}

.evaluation-table input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.easiest-information-fieldset {
  margin: 24px 0 0;
  padding: 16px;
  border: 1px solid #c7ccd1;
  border-radius: 10px;
}

.easiest-information-fieldset legend {
  padding: 0 8px;
  font-weight: 700;
}

.easiest-information-fieldset label {
  display: block;
  margin: 10px 0;
}


/* ========================================
   VERGLEICH DER FINALEN TESTS
======================================== */

/*
   Der Vergleich sieht jetzt ebenfalls
   wie eine normale Karte aus.
*/

.final-feedback {
  margin-top: 0;
}

.final-feedback h3 {
  margin-top: 0;
}

.final-feedback fieldset {
  margin: 20px 0 28px;

  padding: 20px;

  border: 1px solid #c7ccd1;
  border-radius: 10px;

  background: #fafafa;
}

.final-feedback legend {
  padding: 0 8px;

  font-weight: 700;
}

.final-feedback > label {
  display: block;

  margin-bottom: 10px;

  font-weight: 700;
}

.final-feedback textarea {
  display: block;

  width: 100%;

  min-height: 130px;

  padding: 13px;

  font-family: inherit;

  font-size: 16px;

  line-height: 1.5;

  border: 2px solid #777;
  border-radius: 8px;

  resize: vertical;

  background: white;
}


/* ========================================
   ABSCHLUSS
======================================== */

.completion-card {
  margin-top: 40px;

  padding: 30px;

  background: #ffffff;

  border: 1px solid #d9dee3;
  border-radius: 14px;

  text-align: center;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 700px) {

  body {
    font-size: 16px;
  }

  .study-container {
    width: min(100% - 20px, 1000px);

    padding-top: 20px;
  }

  .intro-card,
  .scenario-card,
  .final-test-card,
  .final-feedback {
    padding: 20px;
  }

  .sound-matching-row {
    align-items: stretch;
    flex-direction: column;
  }

  .sound-matching-select {
    width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .audio-buttons {
    grid-template-columns: 1fr;
  }

  .audio-button {
    min-height: 60px;
  }

  .evaluation-table th,
  .evaluation-table td {
    padding: 10px 8px;
  }
}
