/* === Base Reset & Typography === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Accessibility === */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: #1a6b8a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

:focus-visible {
  outline: 3px solid #2d9cdb;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #2d9cdb;
  outline-offset: 2px;
}

#main-content:focus {
  outline: none;
}

/* Content pages (changelog, toegankelijkheid) */
.content-page {
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin: 1rem auto;
}
.content-page h2 {
  color: #1a6b8a;
  margin-bottom: 1rem;
}
.content-page h3 {
  color: #124d65;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.content-page p,
.content-page ul {
  margin-bottom: 1rem;
  line-height: 1.6;
}
.content-page ul {
  padding-left: 1.5rem;
}
.content-page code {
  background: #f5f7fa;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.changelog-text {
  background: #f5f7fa;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

:root {
  --color-primary: #1a6b8a;
  --color-primary-dark: #124d65;
  --color-primary-light: #e8f4f8;
  --color-accent: #16729f;          /* darkened from #2d9cdb to pass 4.5:1 */
  --color-success: #1e8449;         /* darkened from #27ae60 */
  --color-warning: #f39c12;
  --color-warning-text: #1a1a1a;    /* dark text for use on the yellow banner */
  --color-danger: #e74c3c;
  --color-danger-dark: #8b1a0e;     /* dark red text for alert boxes */
  --color-success-dark: #1a5d33;    /* dark green text for alert boxes */
  --color-bg: #f5f7fa;
  --color-white: #ffffff;
  --color-text: #2c3e50;
  --color-text-light: #5a6c75;      /* darkened from #7f8c8d */
  --color-border: #8a96a2;          /* darkened from #dce1e6 to pass 3:1 */
  --color-border-light: #dce1e6;    /* old shade for purely decorative separators */
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

/* === Info Banner === */
.beta-banner {
  background: var(--color-warning);
  color: var(--color-warning-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  font-size: 0.85rem;
  gap: 16px;
}

.beta-banner-text {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}

.beta-banner-feedback {
  color: var(--color-warning-text);
  text-decoration: underline;
  white-space: nowrap;
  font-weight: 700;
  flex-shrink: 0;
}

/* === Header === */
.site-header {
  background: var(--color-white);
  border-bottom: 3px solid var(--color-primary);
  padding: 16px 32px;
  box-shadow: var(--shadow);
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.header-logos .logo {
  height: 120px;
  max-width: 540px;
  width: auto;
  object-fit: contain;
}

.header-logos .logo-wbd {
  height: 60px;
}

.header-title {
  text-align: center;
}

.header-title h1 {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin: 0;
}

.header-title h1 a {
  color: inherit;
}

.header-title .subtitle {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

/* === Container === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}

/* === Footer === */
.site-footer {
  padding: 16px 32px;
  color: var(--color-text-light);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-white);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}

.footer-text {
  text-align: left;
}

.footer-makers {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  height: 96px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-logo:hover {
  opacity: 1;
}

.footer-link {
  color: var(--color-text-light);
  text-decoration: underline;
}

.footer-link:hover {
  color: var(--color-primary);
}

/* === Suggestion form === */
.suggestion-form .form-group {
  margin-bottom: 16px;
}

.suggestion-form .actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 24px;
}

/* === Landing Page === */
.landing {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro-card,
.upload-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.intro-card h2,
.upload-card h2 {
  color: var(--color-primary);
  margin-bottom: 12px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.feature {
  text-align: center;
  padding: 16px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 1.3rem;
  font-weight: bold;
  margin: 0 auto 12px;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-primary-dark);
}

.feature p {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.actions {
  text-align: center;
  margin-top: 16px;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #c5ccd3;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary-light);
}

.btn-file {
  background: var(--color-accent);
  color: white;
  padding: 10px 20px;
}

.btn-submit {
  background: var(--color-success);
  color: white;
  font-size: 1.1rem;
  padding: 14px 36px;
}

.btn-submit:hover {
  background: #219a52;
}

/* === Validation errors === */
.card-error {
  border-left-color: var(--color-danger) !important;
  box-shadow: 0 0 0 1px var(--color-danger);
}

.field-error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}

/* === Upload form === */
.upload-form {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Show focus on the visible label when the hidden file input is focused */
.file-input-wrapper input[type="file"]:focus-visible + label {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.file-name {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* === Alert === */
.alert {
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.alert-error {
  background: #fde8e8;
  color: var(--color-danger-dark);
  border: 1px solid #f5c6c6;
}

.alert-success {
  background: #e8f8ee;
  color: var(--color-success-dark);
  border: 1px solid #c6f5d5;
}

/* === Disclaimer Banner === */
.disclaimer-banner {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #5d4037;
}

.disclaimer-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #bf360c;
  font-size: 0.92rem;
}

.disclaimer-banner p {
  margin: 0;
}

/* === Progress Bar === */
.progress-bar {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  overflow-x: auto;
}

.progress-step {
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 8px;
}

.progress-step .step-number {
  display: block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background: var(--color-border-light);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: bold;
  margin: 0 auto 4px;
  transition: background 0.2s;
}

.progress-step .step-label {
  font-size: 0.7rem;
  color: var(--color-text);
  display: block;
  white-space: nowrap;
}

.progress-step.active .step-number {
  background: var(--color-primary);
  color: white;
}

.progress-step.done .step-number {
  background: var(--color-success);
  color: white;
}

.progress-track {
  height: 4px;
  background: var(--color-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  width: 0;
  transition: width 0.3s ease;
}

/* === Form Steps === */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-step h2 {
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-light);
}

/* === Form Groups === */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.15);
}

.required {
  color: #c0392b;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error-message {
  color: var(--color-danger-dark);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 6px 10px;
  background: #fde8e8;
  border-left: 3px solid var(--color-danger);
  border-radius: 4px;
}

.error-summary {
  background: #fde8e8;
  border: 2px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  color: var(--color-danger-dark);
}

.error-summary h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--color-danger-dark);
}

.error-summary ul {
  margin: 0;
  padding-left: 20px;
}

.error-summary a {
  color: var(--color-danger-dark);
  text-decoration: underline;
}

.restore-banner {
  background: #fff8e1;
  border: 2px solid #f39c12;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  color: #1a1a1a;
}

.restore-banner p {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
}

.restore-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.restore-banner-actions .btn {
  padding: 8px 18px;
  font-size: 0.9rem;
}

.help-text {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

/* === Checkbox Grid === */
.checkbox-grid {
  display: grid;
  gap: 8px;
}

.checkbox-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-primary-light);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: normal;
  transition: background 0.2s;
}

.checkbox-item label:hover {
  background: #d4ecf4;
}

.checkbox-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.checkbox-item small {
  color: var(--color-text-light);
}

/* === Question Cards === */
.question-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-primary-light);
  transition: border-color 0.2s;
}

.question-card:has(input[name$="_main"]:checked) {
  border-left-color: var(--color-primary);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.question-header h3 {
  font-size: 1rem;
  color: var(--color-primary-dark);
}

.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.info-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  font-style: italic;
}

.question-text {
  color: var(--color-text);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.info-panel {
  background: var(--color-primary-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* === Answer Options === */
.answer-options {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.radio-option-na {
  background: #f0f4ff;
  border-color: #7b9fd4;
  color: #2c5282;
  font-style: italic;
}

.radio-option-na:hover {
  background: #dbeafe;
}

.radio-option-na:has(input:checked) {
  background: #dbeafe;
  outline-color: #3b82f6;
}

.radio-option-skip {
  margin-left: auto;
  opacity: 0.6;
}

.radio-option-skip:hover {
  opacity: 1;
}

.radio-option-skip:has(input:checked) {
  opacity: 1;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  font-weight: normal;
}

.radio-option:hover {
  background: var(--color-primary-light);
}

.radio-option input[type="radio"]:checked + .radio-label {
  font-weight: 600;
}

.radio-option:has(input:checked) {
  background: var(--color-primary-light);
  outline: 2px solid var(--color-primary);
}

.sub-fields {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.sub-choice {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* === AI Generate Button & Output === */
.btn-ai {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn-ai:hover {
  opacity: 0.85;
}

.btn-ai:disabled {
  opacity: 0.5;
  cursor: wait;
}

.generated-answer-group {
  margin-top: 12px;
  padding: 12px;
  background: var(--color-primary-light);
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
}

.generated-answer-group label {
  font-size: 0.85rem;
  color: var(--color-primary-dark);
}

.generated-answer {
  background: var(--color-white) !important;
  border-color: var(--color-accent) !important;
  font-style: italic;
}

.btn-use-generated {
  margin-top: 8px;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
}

/* === Form Navigation === */
.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

/* === TOC Modal === */
.toc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.toc-modal {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.toc-modal h3 {
  margin-bottom: 16px;
  color: var(--color-primary);
}

.toc-modal p {
  margin-bottom: 12px;
}

.toc-modal ol {
  margin: 0 0 20px 20px;
}

.toc-modal ol li {
  margin-bottom: 4px;
}

.toc-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* === Disclaimer Page === */
.disclaimer-page h2 {
  color: var(--color-primary);
  margin-bottom: 16px;
}

.disclaimer-intro {
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.7;
}

.disclaimer-rules {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.disclaimer-rule h3 {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.disclaimer-rule ul {
  margin: 0;
  padding-left: 20px;
}

.disclaimer-rule li {
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 4px;
  color: var(--color-text);
}

.disclaimer-kernregel {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  padding: 14px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.disclaimer-kernregel strong {
  color: var(--color-primary-dark);
}

/* === Privacy Notice (index page) === */
.privacy-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--color-primary-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 4px;
}

.privacy-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* === Disclaimer Agreement (index page) === */
.disclaimer-agree {
  margin-top: 24px;
  padding: 16px 20px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
}

.checkbox-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: normal !important;
}

.checkbox-agree input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.checkbox-agree span {
  font-size: 0.95rem;
  line-height: 1.5;
}

.checkbox-agree a {
  font-weight: 600;
  text-decoration: underline;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* === Responsive === */
@media (max-width: 768px) {
  .site-header {
    padding: 12px 16px;
  }

  .header-logos {
    gap: 12px;
  }

  .header-logos .logo {
    height: 60px;
    max-width: 280px;
  }

  .container {
    padding: 16px 12px;
  }

  .intro-card,
  .upload-card {
    padding: 20px;
  }

  .progress-step .step-label {
    display: none;
  }

  .answer-options {
    flex-direction: column;
  }

  .upload-form {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-card {
    padding: 16px;
  }
}
