@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */

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

:root {
  color-scheme: light only;
  --salmon: #e8a091;
  --salmon-light: #f5c4b8;
  --salmon-dark: #c47a6c;
  --sand: #f5e6d3;
  --sand-light: #faf4eb;
  --sand-dark: #d4c4a8;
  --terracotta: #c4785a;
  --brown: #8b5a3c;
  --cream: #fffbf7;
  --text: #4a3728;
  --text-light: #7a6555;
  --error: #d64545;
  --error-light: #fee;
  --success: #2d8a4e;
  --success-light: #e8f5e9;
  --teal: #7cc5c0;
  --teal-dark: #5aada8;

  /* Negative outline - outer stroke using fill color (main containers only) */
  --outline-width: 6px;

  /* Alignment rig: defines position of progress bar center from container top */
  /* The divider (.container::after) is positioned at this Y coordinate */
  --sidebar-padding-top: 40px;
  --sidebar-h2-height: 48px; /* Fixed height - "Monitoring Cultureel" on 2 lines */
  --divider-margin: 12px;
  --divider-height: 1px;
  --progress-bar-height: 8px;

  /* Calculated: Y position where progress bar center AND content divider sit */
  --progress-bar-center-y: calc(
    var(--sidebar-padding-top) +
    var(--sidebar-h2-height) +
    var(--divider-margin) +
    var(--divider-height) +
    var(--divider-margin) +
    (var(--progress-bar-height) / 2)
  );
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--sand) 0%, var(--salmon-light) 50%, var(--sand-light) 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
  transition: background 0.5s ease;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 40px;
  position: relative;
}

.login-card {
  position: relative;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  /* No overflow:hidden - header needs explicit border-radius */
}

/* Compound shape: unified background + outer stroke as single pseudo-element */
.login-card::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--outline-width));
  left: calc(-1 * var(--outline-width));
  right: calc(-1 * var(--outline-width));
  bottom: calc(-1 * var(--outline-width));
  background: var(--cream);
  border-radius: calc(16px + var(--outline-width));
  box-shadow:
    0 8px 32px rgba(139, 90, 60, 0.15),
    0 2px 8px rgba(139, 90, 60, 0.1);
  mix-blend-mode: screen;
  z-index: -1;
}

.login-header {
  background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
  padding: 40px 32px;
  text-align: center;
  color: white;
  border-radius: 16px 16px 0 0;
}

.logo-icon {
  width: 56px;
  height: 64px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.logo-icon svg {
  width: auto;
  height: 38px;
}

.login-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.year-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-body {
  padding: 32px;
}

.login-intro {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

.login-footer a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Demo Mode Styles */
.demo-banner {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border: 1px solid #0ea5e9;
  color: #0369a1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.public-access {
  margin-top: 20px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--sand-dark);
}

.divider span {
  padding: 0 12px;
}

.login-info {
  max-width: 360px;
  color: var(--text);
}

.login-info h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.login-info p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.login-info ul {
  list-style: none;
  margin-bottom: 20px;
}

.login-info li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-light);
}

.login-info li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--terracotta);
  font-weight: bold;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
}

.privacy-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--terracotta);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--cream);
  color: var(--text);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.field input:not(:placeholder-shown),
.field textarea:not(:placeholder-shown),
.field select:not([value=""]) {
  opacity: 1;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(232, 160, 145, 0.25);
  opacity: 1;
}

.field input.error,
.field textarea.error {
  border-color: var(--error);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* Checkbox label styling */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  opacity: 0.7;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--terracotta);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-label:has(input:checked) {
  opacity: 1;
}

/* Multi-input group for repeated text fields */
.multi-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--cream);
  color: var(--text);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.multi-input-group input:not(:placeholder-shown) {
  opacity: 1;
}

.multi-input-group input:focus {
  outline: none;
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(232, 160, 145, 0.25);
  opacity: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  padding: 12px 36px;
  font-size: 14px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  background: var(--cream);
  border: 2px solid var(--sand-dark);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--sand-light);
  border-color: var(--salmon);
}

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

.btn-tertiary:hover {
  background: rgba(196, 120, 90, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(196, 120, 90, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(196, 120, 90, 0.4);
}

.btn-primary:disabled {
  background: var(--sand-dark);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn-disabled-top {
  background: var(--sand-dark);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Error & Success Messages
   ========================================================================== */

.error-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--error-light);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--error);
}

.error-message svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.success-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--success-light);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--success);
}

/* ==========================================================================
   Survey Page - Container
   ========================================================================== */

.survey-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  position: relative;
  border-radius: 12px;
  width: 900px;
  max-width: calc(100vw - 40px);
  min-height: 540px;
  display: flex;
  /* No overflow:hidden - sidebar needs explicit border-radius */
}

/* Alignment rig: Single divider line that guarantees alignment with progress bar */
.container::after {
  content: '';
  position: absolute;
  top: var(--progress-bar-center-y);
  left: calc(260px + (100% - 260px) * 0.05); /* Centered in content area (5% margin each side) */
  width: calc((100% - 260px) * 0.9); /* 90% of content area width */
  height: var(--divider-height);
  background: rgba(212, 196, 168, 0.33); /* --sand-dark at 33% opacity (2/3 transparent) */
  pointer-events: none;
  z-index: 1;
}

/* Compound shape: unified background + outer stroke as single pseudo-element */
.container::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--outline-width));
  left: calc(-1 * var(--outline-width));
  right: calc(-1 * var(--outline-width));
  bottom: calc(-1 * var(--outline-width));
  background: var(--cream);
  border-radius: calc(12px + var(--outline-width));
  box-shadow:
    0 8px 32px rgba(139, 90, 60, 0.15),
    0 2px 8px rgba(139, 90, 60, 0.1);
  z-index: -1;
}

/* ==========================================================================
   Survey Page - Index Sidebar
   ========================================================================== */

.index {
  flex: 0 0 260px;
  padding: var(--sidebar-padding-top) 20px;
  background: linear-gradient(180deg, rgba(232, 160, 145, 0.15) 0%, rgba(245, 230, 211, 0.3) 100%);
  display: flex;
  flex-direction: column;
  border-radius: 12px 0 0 12px;
  position: relative; /* For highlighter positioning */
  overflow: visible; /* Allow outcrop to extend left */
  user-select: none;
}

/* Desktop Highlighter - moves behind active item */
.mobile-highlighter {
  position: absolute;
  left: -20px; /* Extend into outcrop area beyond sidebar */
  top: 0;
  right: 8px;
  height: 38px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 19px 8px 8px 19px; /* Fully rounded left, normal right */
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(1);
  transform-origin: right center;
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.6s ease-out,
    box-shadow 0.6s ease-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mobile-highlighter.active {
  opacity: 1;
}

/* Highlighter shape for regular items - fully rounded left */
.mobile-highlighter.highlighter-item {
  left: -20px; /* Extend beyond sidebar left edge */
  border-radius: 19px 8px 8px 19px;
}

/* Highlighter shape for section dividers - matches hover element style */
.mobile-highlighter.highlighter-divider {
  left: -20px;
  right: 8px;
  border-radius: 19px 8px 8px 19px;
}

/* Highlighter shape for subsection headers - centered with mild rounded corners */
.mobile-highlighter.highlighter-subsection {
  left: 50%;
  right: auto;
  width: 120px;
  transform: translateX(-50%);
  border-radius: 6px;
  height: 28px !important;
  /* Offset to center on text: border-top (1px) + padding-top (12px) - half padding difference */
  margin-top: 5px;
}

/* Highlighter hover effect - scale up when hovering on active item */
.index:has(.index-item.active:hover) .mobile-highlighter.highlighter-item,
.index:has(.index-divider-clickable.active:hover) .mobile-highlighter:not(.highlighter-item) {
  transform: scale(1.015);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

/* Subsection highlighter hover - needs different transform-origin */
.index:has(.index-divider-sub.active:hover) .mobile-highlighter.highlighter-subsection {
  transform: translateX(-50%) scale(1.015);
  transform-origin: center center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.index h2 {
  font-size: 16px;
  font-weight: 600;
  height: var(--sidebar-h2-height); /* Fixed height for alignment rig */
  color: var(--text);
  opacity: 0.55;
  margin-bottom: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.index-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  z-index: 1; /* Above highlighter */
}

.index-item:hover {
  background: rgba(255, 255, 255, 0.3);
}

.index-item.active {
  background: transparent; /* Highlighter handles this */
}

.index-item .status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
  transition:
    transform 0.6s ease-out,
    background 0.3s ease-out;
}

/* Push status icon into outcrop when active + enlarge + teal */
.index-item.active .status {
  transform: translateX(-42px) scale(1.15);
  background: var(--teal);
}

/* Scale up icon further on hover - shift left to follow highlighter expansion */
.index-item.active:hover .status {
  transition: transform 0.15s ease-out;
  transform: translateX(-46px) scale(1.18);
}

/* Completed but not active - darker terracotta */
.index-item.complete .status {
  background: var(--terracotta);
}

/* Active AND complete - more saturated teal to show prominence */
.index-item.active.complete .status {
  background: var(--teal-dark);
}

.index-item.partial .status {
  background: var(--salmon);
}

/* Active AND partial - teal */
.index-item.active.partial .status {
  background: var(--teal);
}

.index-item.conditional-incomplete .status {
  background: var(--salmon);
}

.index-item .label {
  font-size: 13px;
  color: var(--text);
  transition: transform 0.6s ease-out;
}

.index-item.active .label {
  font-weight: 600;
  transform: translateX(-32px) scale(1.1);
}

/* Scale up label further on hover - shift left to follow highlighter expansion */
.index-item.active:hover .label {
  transform: translateX(-36px) scale(1.12);
  transition: transform 0.15s ease-out;
}

/* Passing state - triggered briefly as highlighter travels over item */
.index-item.passing .status {
  transform: translateX(-12px) scale(1.05);
  transition: transform 0.06s ease-out;
}

.index-item.passing .label {
  transform: translateX(-8px) scale(1.02);
  transition: transform 0.06s ease-out;
}

/* Index dividers for grouping navigation items */
.index-divider {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px 6px;
  margin-top: 8px;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  border-top: 1px solid rgba(180, 160, 140, 0.3);
}

/* Clickable divider that navigates to a step */
.index-divider-clickable {
  cursor: pointer;
  transition: all 0.35s ease-in-out;
  border-radius: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding: 12px 20px;
  position: relative;
  z-index: 1; /* Above highlighter */
}

.index-divider-clickable:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--terracotta);
}

.index-divider-clickable.active {
  background: transparent; /* Highlighter handles this */
  color: var(--terracotta);
}

/* Full-width divider line */
.index-divider-full {
  height: var(--divider-height);
  background: rgba(180, 160, 140, 0.3);
  margin: var(--divider-margin) -20px;
}

/* Subsection divider - 80% width, centered */
.index-divider-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0 6px;
  margin: 8px auto 0;
  width: 80%;
  border-top: 1px solid rgba(180, 160, 140, 0.3);
  text-align: center;
}

.index-divider-sub.index-divider-clickable {
  cursor: pointer;
  transition: all 0.35s ease-in-out;
  position: relative;
  z-index: 1;
}

.index-divider-sub.index-divider-clickable:hover {
  color: var(--terracotta);
}

.index-divider-sub.index-divider-clickable.active {
  color: var(--terracotta);
}

/* Scale up subsection text on hover when active */
.index-divider-sub.index-divider-clickable.active:hover {
  transform: scale(1.03);
}

.org-info {
  margin-top: 12px;
  padding-top: 12px;
}

.org-info .org-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.org-info .org-code {
  font-size: 11px;
  color: var(--text-light);
}

.logout-btn {
  margin-top: 12px;
  font-size: 12px;
  color: var(--terracotta);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.logout-btn:hover {
  color: var(--salmon-dark);
}

/* ==========================================================================
   Survey Page - Content Area
   ========================================================================== */

.content {
  flex: 1;
  min-width: 0;
  padding: 20px 60px 20px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.content-header {
  flex-shrink: 0;
  margin-bottom: 32px;
  padding-bottom: 24px;
  user-select: none;
}

.content-scrollable {
  position: relative;
  /* Much taller max-height - allows card to expand significantly */
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: clip; /* Clip but allow positioned elements to paint outside */
  scroll-behavior: smooth;
  /* Vertical spacing - tighter at top, relaxed at bottom */
  padding-bottom: 24px;
  padding-right: 40px; /* Space for checkmarks to overflow into */
  /* Hide native scrollbar - we use custom one */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide WebKit scrollbar */
.content-scrollable::-webkit-scrollbar {
  display: none;
}

/* During step animation, allow content to overflow so slide animation isn't clipped */
.content-scrollable.animating {
  overflow: visible;
}

/* Custom scrollbar - completely decoupled, position anywhere */
.custom-scrollbar {
  position: absolute;
  top: 80px; /* Below header area */
  right: -40px; /* Positioned well outside the content area */
  bottom: 80px; /* Above footer area */
  width: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

/* Show scrollbar when content is scrollable */
.content-scrollable-wrapper:hover .custom-scrollbar,
.content-scrollable-wrapper.scrolling .custom-scrollbar {
  opacity: 1;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 30px;
  background: var(--salmon);
  border-radius: 2px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease;
}

.custom-scrollbar-thumb:hover {
  background: var(--terracotta);
}

/* Gradient fade mask container */
.content-scrollable-wrapper {
  position: relative;
}

.content-scrollable-wrapper::before,
.content-scrollable-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 40px; /* Don't cover scrollbar */
  height: 32px;
  pointer-events: none;
  z-index: 2;
}

.content-scrollable-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, var(--cream) 0%, transparent 100%);
  opacity: 0; /* Start hidden until user scrolls */
  transition: opacity 0.3s ease;
}

.content-scrollable-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, var(--cream) 0%, transparent 100%);
  opacity: 0; /* Start hidden until user scrolls */
  transition: opacity 0.3s ease;
}

/* Show gradients once user has scrolled */
.content-scrollable-wrapper.has-scrolled::before,
.content-scrollable-wrapper.has-scrolled::after {
  opacity: 1;
}

/* Hide gradients when at scroll limits */
.content-scrollable-wrapper.has-scrolled.at-top::before {
  opacity: 0;
}

.content-scrollable-wrapper.has-scrolled.at-bottom::after {
  opacity: 0;
}

.content-footer {
  flex-shrink: 0;
  margin-top: 32px;
  padding-top: 24px;
  user-select: none;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.section-num {
  color: #995544; /* Dark terracotta to match Likert header */
}

.subtitle {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.info-box {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--sand) 100%);
  border-left: 3px solid var(--terracotta);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text);
  border-radius: 0 8px 8px 0;
}

.info-box-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.info-box-link:hover {
  background: linear-gradient(135deg, var(--sand) 0%, #e8dcc8 100%);
  border-left-color: var(--terracotta-dark, #c55a3a);
  transform: translateX(2px);
}

.info-box-link .info-box-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.info-box-link:hover .info-box-icon {
  opacity: 1;
}

/* Larger info box for intro/informational pages */
.info-box-large {
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
}

.info-box-large p {
  margin-bottom: 12px;
}

.info-box-large p:last-child {
  margin-bottom: 0;
}

/* Answer categories box for qualitative intro */
.answer-categories-box {
  background: white;
  border: 2px solid var(--terracotta);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.answer-categories-box h3 {
  color: var(--terracotta);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.answer-categories-box p {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text);
}

.answer-categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.answer-categories-list li {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--sand) 100%);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 600px) {
  .answer-categories-list {
    grid-template-columns: 1fr;
  }
}

.form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  overflow: visible; /* Allow checkmarks to overflow */
}

.form-section > * {
  min-width: 0;
  max-width: 100%;
}

.form-section::-webkit-scrollbar {
  width: 6px;
}

.form-section::-webkit-scrollbar-track {
  background: var(--sand-light);
  border-radius: 3px;
}

.form-section::-webkit-scrollbar-thumb {
  background: var(--salmon);
  border-radius: 3px;
}

/* ==========================================================================
   Question Numbering
   ========================================================================== */

.q-num {
  color: var(--terracotta);
  font-weight: 600;
  display: inline-block;
  min-width: 2.5em;
  margin-left: -2.5em;
}

.field label .q-num,
.question-text .q-num,
.likert-table td .q-num {
  margin-left: 0;
  margin-right: 0.5em;
  min-width: auto;
}

/* ==========================================================================
   Survey Page - Question Elements
   ========================================================================== */

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.question-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.reset-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--sand);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.question-header.has-value .reset-btn {
  opacity: 1;
  pointer-events: auto;
}

.reset-btn:hover {
  background: var(--salmon-light);
  color: var(--terracotta);
}

/* ==========================================================================
   Survey Page - Option Cards
   ========================================================================== */

.option-card {
  border: 2px solid var(--sand-dark);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--cream);
  opacity: 0.6;
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-card:hover {
  border-color: var(--salmon);
  background: var(--sand-light);
  opacity: 0.85;
}

.option-card.selected {
  border-color: var(--terracotta);
  background: var(--sand-light);
  opacity: 1;
  box-shadow: 0 4px 16px rgba(196, 120, 90, 0.15);
  transform: translateY(-2px);
}

/* Option card with unfilled conditional - waiting state */
.option-card.selected.awaiting-conditional {
  border-color: var(--salmon);
  box-shadow: 0 2px 8px rgba(232, 160, 145, 0.2);
  transform: translateY(-1px);
}

/* Full completion - satisfied conditional */
.option-card.selected.conditional-satisfied {
  border-color: var(--terracotta);
  box-shadow: 0 6px 20px rgba(196, 120, 90, 0.2);
  transform: translateY(-3px);
}

.option-card input {
  display: none;
}

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-light);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

/* Hover shade on radio dot */
.option-card:hover .option-radio {
  background: rgba(196, 120, 90, 0.12);
  border-color: var(--salmon);
}

.option-card.selected .option-radio {
  border-color: transparent;
  background: transparent;
}

/* Contracting outer ring - target lock effect */
@keyframes ring-contract {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Inner dot rapid fade in */
@keyframes dot-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.option-card.selected .option-radio::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--terracotta);
  border-radius: 50%;
  box-sizing: border-box;
  animation: ring-contract 0.25s ease-out forwards;
}

.option-card.selected .option-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--terracotta);
  border-radius: 50%;
  animation: dot-fade-in 0.12s ease-out forwards;
}

.option-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.option-content p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}

/* ==========================================================================
   Survey Page - Conditional Fields
   ========================================================================== */

.conditional {
  margin-left: 32px;
  padding: 16px;
  padding-right: 0;
  border-left: 2px solid var(--salmon);
  margin-top: 0;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(232, 160, 145, 0.08) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out, padding 0.3s ease-out;
  visibility: hidden;
  width: calc(100% - 32px);
}

.conditional.show {
  max-height: 500px;
  opacity: 1;
  padding-top: 16px;
  padding-bottom: 16px;
  visibility: visible;
}

.conditional .field input {
  width: 100%;
}

/* ==========================================================================
   Survey Page - Likert Scale Table
   ========================================================================== */

.likert-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-bottom: 16px;
  overflow: visible;
  table-layout: fixed; /* Ensures column widths are respected for pill rig */
}

.likert-table tbody {
  overflow: visible;
}

.likert-table th {
  background: var(--sand);
  padding: 10px 4px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  border-bottom: 2px solid var(--sand-dark);
}

.likert-table th:first-child {
  text-align: left;
  width: 45%;
  padding-left: 8px;
  border-radius: 8px 0 0 0;
}

/* Equal width for all option columns */
.likert-table th:not(:first-child) {
  width: 13.75%;
}

.likert-table th.likert-header-label {
  color: #995544; /* Much darker terracotta to counter anti-aliasing */
}

.likert-table th:last-child {
  border-radius: 0 8px 0 0;
}

.likert-table td {
  padding: 12px 4px;
  border-bottom: 1px solid var(--sand);
  text-align: center;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.likert-table td:first-child {
  text-align: left;
  padding-left: 8px;
}

.likert-table tbody tr {
  opacity: 0.85;
  transition: opacity 0.2s ease, background 0.2s ease;
  position: relative;
}

.likert-table tbody tr.answered {
  opacity: 1;
}

/* Pill highlight - positioned by JS in first radio cell */
.likert-pill-highlight {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  background: rgba(180, 160, 140, 0.12);
  border-radius: 100px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: pill-fade-in 0.2s ease-out forwards;
  /* left and width set by JS based on actual measurements */
}

.likert-pill-highlight.fade-out {
  animation: pill-fade-out 0.2s ease-out forwards;
}

@keyframes pill-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pill-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.likert-table input[type="radio"] {
  position: relative;
  z-index: 2;
}

.likert-table tbody tr.answered::after {
  content: '✓';
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--terracotta);
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.4;
}

.likert-table tbody tr.answered.just-answered::after {
  animation: checkmark-pop 0.25s ease-out;
}

@keyframes checkmark-pop {
  0% {
    transform: translateY(-50%) scale(0.5);
    opacity: 0;
  }
  70% {
    transform: translateY(-50%) scale(1.15);
    opacity: 0.5;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.4;
  }
}

/* Bouncing arrow for unfilled rows */
.likert-table.has-missing tbody tr:not(.answered)::after {
  content: '‹';
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: #2a9d8f;
  font-weight: 900;
  font-size: 20px;
  pointer-events: none;
  opacity: 0.5;
  animation: arrow-bounce 2s ease-in-out infinite;
}

@keyframes arrow-bounce {
  0%, 100% {
    transform: translateY(-50%) translateX(0px);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-50%) translateX(-3px);
    opacity: 0.7;
  }
}

/* ==========================================================================
   Custom Likert Radio - Built from scratch
   ========================================================================== */

/* Hide native radio but keep it functional for form data */
.likert-table input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Custom radio container */
.likert-radio {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  cursor: pointer;
  z-index: 1;
}

/* Base circle - the stable dot */
.likert-radio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-light);
  border-radius: 50%;
  background: white;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

/* Hover: darken border */
.likert-radio:hover::before {
  border-color: var(--text);
}

/* Ghost dot on hover */
.likert-radio::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.likert-radio:hover::after {
  opacity: 0.4;
}

/* Selected state - hide ghost, show fill */
.likert-radio.selected::after {
  background: var(--terracotta);
  opacity: 1;
}

.likert-radio.selected::before {
  border-color: var(--terracotta);
}

/* Target ring element for homing animation */
.likert-radio .target-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--terracotta);
  border-radius: 50%;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
}

.likert-radio.selected .target-ring {
  animation: likert-ring-contract 0.25s ease-out forwards;
}

@keyframes likert-ring-contract {
  0% {
    opacity: 1;
    transform: scale(1.8);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

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

.likert-header .reset-btn {
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.likert-header.has-value .reset-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Likert segmented controls - hidden on desktop */
.likert-segment {
  display: none;
}

/* ==========================================================================
   Survey Page - Section Headers
   ========================================================================== */

.section-header {
  background: linear-gradient(135deg, var(--sand) 0%, var(--sand-light) 100%);
  padding: 10px 14px;
  margin: 20px 0 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--salmon);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
  opacity: 0.6;
}

.section-header .status-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  font-size: 12px;
}

.section-header.complete {
  opacity: 1;
  border-left-color: var(--terracotta);
  background: linear-gradient(135deg, rgba(232, 160, 145, 0.2) 0%, var(--sand-light) 100%);
}

.section-header.complete .status-icon {
  background: var(--terracotta);
  color: white;
}

.section-header.partial {
  opacity: 0.8;
  border-left-color: var(--salmon);
}

.section-header.partial .status-icon {
  background: var(--salmon);
  color: white;
}

/* Half-done state: conditional fields not yet filled */
.section-header.conditional-incomplete {
  opacity: 0.85;
  border-left-color: var(--salmon);
}

.section-header.conditional-incomplete .status-icon {
  background: var(--salmon);
  color: white;
}

/* Section description/toelichting text */
.section-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 16px;
  padding: 0 2px;
  line-height: 1.5;
  font-style: italic;
}

/* ==========================================================================
   Question Group Completion Effects - Lift & Shadow
   ========================================================================== */

/* Question group wrapper for completion tracking */
.question-group {
  position: relative;
  margin-bottom: 20px;
  padding: 16px;
  margin-left: -16px;
  margin-right: -16px;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

/* Lift effect for completed question groups */
.question-group.complete {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 20px rgba(139, 90, 60, 0.12), 0 2px 8px rgba(139, 90, 60, 0.08);
  transform: translateY(-2px);
}

/* Subtle state for partial/conditional-incomplete groups */
.question-group.conditional-incomplete {
  background: rgba(232, 160, 145, 0.06);
  border: 1px dashed var(--salmon);
}

/* Option card enhancement when parent group is complete */
.question-group.complete .option-card.selected {
  box-shadow: 0 2px 12px rgba(196, 120, 90, 0.2);
}

/* Completed section header gets extra visual polish */
.section-header.complete {
  box-shadow: 0 2px 8px rgba(196, 120, 90, 0.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   Survey Page - Navigation
   ========================================================================== */

/* ==========================================================================
   Survey Page - Top Bar (dots + print + nav)
   ========================================================================== */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 48px; /* Push buttons down, away from dots */
  padding-bottom: 8px; /* Close to divider line */
  margin-bottom: 6px;
  /* No border - divider is drawn by .container::after alignment rig */
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
}

.nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.nav-buttons-top {
  margin: 0;
  padding: 0;
}

/* Small button variant */
.btn-small {
  padding: 6px 16px;
  font-size: 12px;
  height: 32px;
  min-width: 80px;
}

.progress-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.progress-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand-dark);
  transition: all 0.3s;
}

.progress-dots span.active {
  background: var(--terracotta);
  width: 24px;
  border-radius: 4px;
}

.progress-dots span.done {
  background: var(--salmon);
}

.progress-dots-top-container {
  position: absolute;
  top: 12px;
  left: 20px;  /* Match .content padding-left */
  right: 60px; /* Match .content padding-right */
  display: flex;
  justify-content: center;
}

.progress-dots-bottom-container {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 12px 0 0 0;
}

.progress-dots-top,
.progress-dots-bottom {
  position: static;
  transform: none;
  justify-content: center;
}

/* ==========================================================================
   Survey Page - Steps
   ========================================================================== */

.step {
  display: none;
  flex-direction: column;
  width: 100%;
}

.step.active {
  display: flex;
  flex: 1;
  width: 100%;
}

/* ==========================================================================
   Slide Transitions for Steps
   ========================================================================== */

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step.slide-up {
  animation: slideInUp 0.35s ease-out forwards;
}

.step.slide-down {
  animation: slideInDown 0.35s ease-out forwards;
}

/* ==========================================================================
   Survey Page - Success State
   ========================================================================== */

.success {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--salmon-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 4px 16px rgba(196, 120, 90, 0.2);
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: var(--terracotta);
}

/* ==========================================================================
   Comments Section - Subtle fallback for edge cases
   ========================================================================== */

.form-section .comments-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sand);
}

.form-section .comments-section button.comments-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  background-color: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-section .comments-section button.comments-toggle:hover {
  opacity: 1;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.form-section .comments-section .comments-label {
  font-size: 12px;
  font-weight: 400;
}

.form-section .comments-section .comments-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s ease-out;
  margin-top: 0;
}

.form-section .comments-section .comments-field.show {
  max-height: 150px;
  opacity: 1;
  margin-top: 8px;
}

.form-section .comments-section .comments-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sand-dark);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--sand-light);
  color: var(--text);
  resize: none;
  min-height: 60px;
  transition: all 0.2s;
}

.form-section .comments-section .comments-field textarea:focus {
  outline: none;
  border-color: var(--salmon);
  background: var(--cream);
}

.form-section .comments-section .comments-field textarea::placeholder {
  color: var(--text-light);
  opacity: 0.6;
  font-size: 12px;
}

/* ==========================================================================
   Progress Bar in Sidebar
   ========================================================================== */

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.progress-bar {
  flex: 1;
  height: var(--progress-bar-height);
  background: var(--sand-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--salmon) 0%, var(--terracotta) 100%);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-percentage {
  font-size: 12px;
  font-weight: 600;
  color: var(--terracotta);
  min-width: 36px;
  text-align: right;
}

/* ==========================================================================
   Print Button
   ========================================================================== */

.btn-print {
  background: var(--cream);
  border: 2px solid var(--sand-dark);
  color: var(--text-light);
  padding: 10px 12px;
}

.btn-print:hover {
  background: var(--sand-light);
  border-color: var(--salmon);
  color: var(--terracotta);
}

.btn-print svg {
  display: block;
}

.btn-print-small {
  padding: 6px 8px;
  border-width: 1px;
}

.btn-print-small svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Reset page */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .survey-body {
    padding: 0 !important;
  }

  /* Hide non-print elements */
  .index,
  .progress-dots,
  .progress-dots-top,
  .progress-dots-bottom,
  .progress-dots-top-container,
  .progress-dots-bottom-container,
  .nav-buttons,
  .nav-buttons-top,
  .btn-print,
  .comments-section,
  .logout-btn,
  .top-bar,
  .bottom-bar {
    display: none !important;
  }

  /* Container styling for print */
  .container {
    box-shadow: none !important;
    background: white !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    min-height: auto !important;
  }

  /* Hide compound shape pseudo-elements for print */
  .container::before,
  .login-card::before {
    display: none !important;
  }

  .content {
    padding: 20px !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  /* Show all steps for printing */
  .step {
    display: flex !important;
    page-break-inside: avoid;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
  }

  .step:last-child {
    border-bottom: none;
  }

  /* Hide review and success steps in print */
  .step[data-step="13"],
  .step[data-step="14"] {
    display: none !important;
  }

  /* Form sections */
  .form-section {
    overflow: visible !important;
    max-height: none !important;
  }

  /* Option cards */
  .option-card {
    opacity: 1 !important;
    break-inside: avoid;
  }

  .option-card.selected {
    border-color: var(--terracotta) !important;
    background: #f5f5f5 !important;
  }

  /* Conditionals */
  .conditional {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .conditional:not(.show) {
    display: none !important;
  }

  /* Tables */
  .likert-table {
    width: 100% !important;
  }

  .likert-table tr {
    opacity: 1 !important;
  }

  /* Page breaks */
  h1 {
    page-break-after: avoid;
  }

  .form-section {
    page-break-inside: avoid;
  }

  /* Print header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--terracotta);
  }

  .print-header h1 {
    font-size: 18px;
    margin-bottom: 5px;
  }

  .print-header p {
    font-size: 12px;
    color: #666;
  }
}

/* Hide print header in normal view */
.print-header {
  display: none;
}

/* ==========================================================================
   Review Step Styles
   ========================================================================== */

.review-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* Complete state - all fields filled */
.review-complete {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
}

.review-complete-icon {
  width: 60px;
  height: 60px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.review-complete-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.review-complete h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 8px;
}

.review-complete p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 24px;
}

/* Incomplete state - some fields missing */
.review-incomplete {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 24px;
}

.review-incomplete-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-incomplete-header svg {
  color: #f59e0b;
  flex-shrink: 0;
}

.review-incomplete-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #92400e;
  margin: 0;
}

.review-incomplete-subtitle {
  font-size: 14px;
  color: #78350f;
  margin-bottom: 20px;
  padding-left: 36px;
}

/* State when all originally incomplete items are now complete */
.review-now-complete {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 24px;
}

.review-all-complete-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-all-complete-header svg {
  color: var(--success);
  flex-shrink: 0;
}

.review-all-complete-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--success);
  margin: 0;
}

.review-now-complete .review-incomplete-subtitle {
  color: #1b5e20;
}

/* Individual review items with accordion */
.review-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.review-item-accordion {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.review-item-accordion:hover {
  border-color: rgba(245, 158, 11, 0.5);
}

.review-item-accordion.accordion-complete {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
}

.review-item-accordion.accordion-complete .review-item-step {
  color: var(--success);
}

.review-item-accordion.accordion-complete .review-item-label::after {
  content: ' ✓';
  color: var(--success);
}

.review-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.review-item-header:hover {
  background: rgba(245, 158, 11, 0.05);
}

.review-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.review-item-step {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.review-item-count {
  font-size: 12px;
  color: var(--text-light);
}

.review-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Accordion chevron */
.accordion-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.accordion-chevron:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.accordion-chevron.open {
  transform: rotate(180deg);
}

/* Accordion content */
.review-item-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid transparent;
}

.review-item-content.open {
  max-height: 2000px;
  padding: 16px;
  border-top-color: rgba(245, 158, 11, 0.2);
}

/* Go to step button */
.btn-review-goto {
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Likert table in review accordion */
.likert-table-review {
  width: 100%;
  font-size: 13px;
}

.likert-table-review th {
  padding: 8px 4px;
  font-size: 11px;
}

.likert-table-review td {
  padding: 8px 4px;
}

.likert-table-review tr.row-incomplete {
  background: rgba(245, 158, 11, 0.1);
}

.likert-table-review tr.row-incomplete td:first-child {
  font-weight: 500;
}

.likert-table-review tr.row-complete {
  background: rgba(16, 185, 129, 0.05);
  color: var(--text-light);
}

/* Review fields container */
.review-fields-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-field.field-complete {
  opacity: 0.7;
}

.review-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.review-field input[type="text"],
.review-field input[type="number"],
.review-field input[type="date"],
.review-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-field input:focus,
.review-field textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(194, 117, 94, 0.1);
}

/* Review radio group */
.review-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-option-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  background: white;
  transition: all 0.2s ease;
}

.review-option-card:hover {
  border-color: var(--terracotta);
}

.review-option-card input[type="radio"] {
  accent-color: var(--terracotta);
}

.review-option-card:has(input:checked) {
  border-color: var(--terracotta);
  background: rgba(194, 117, 94, 0.05);
}

/* Review checkbox label */
.review-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.review-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--terracotta);
}

/* Confirmation checkbox */
.review-confirm {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.review-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.review-confirm-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--terracotta);
  flex-shrink: 0;
}

/* Submit button on review page */
.btn-submit-review {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
}

.btn-submit-review:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
  }

  .login-info {
    max-width: 420px;
  }

  .container {
    flex-direction: column;
  }

  .index {
    flex: none;
    padding: 20px;
    border-radius: 12px 12px 0 0;
  }

  .content {
    padding: 30px 20px;
  }
}

@media (max-width: 600px) {
  .login-card {
    max-width: 100%;
  }

  .login-header {
    padding: 30px 24px;
  }

  .login-body {
    padding: 24px;
  }

  .login-info {
    display: none;
  }
}

/* ==========================================================================
   Modal Overlays
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.modal-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.modal-text-warning {
  color: #b45309;
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-icon-info {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--salmon-light) 100%);
}

.modal-icon-info svg {
  color: var(--terracotta);
}

.modal-icon-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.modal-icon-warning svg {
  color: #d97706;
}

.modal-icon-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.modal-icon-error svg {
  color: #dc2626;
}

/* Modal Link */
.modal-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.modal-link:hover {
  color: var(--terracotta-dark, #a85c46);
  text-decoration: underline;
}

/* Modal Options (stacked buttons) */
.modal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  font-size: 15px;
  width: 100%;
}

.modal-btn-subtitle {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 4px;
}

/* Modal Buttons (side by side) */
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-buttons .btn {
  flex: 1;
  padding: 12px 20px;
}

/* Danger button */
.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Mobile responsive modals */
@media (max-width: 500px) {
  .modal-content {
    padding: 30px 24px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-buttons .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Archived Forms Section
   ========================================================================== */

.modal-content-wide {
  max-width: 560px;
}

.archived-forms-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
}

.archived-forms-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.archived-forms-divider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.archived-forms-divider::before,
.archived-forms-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand);
}

.archived-forms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.archived-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: 8px;
  text-align: left;
  transition: all 0.2s ease;
}

.archived-form-item:hover {
  border-color: var(--terracotta-light);
  background: white;
}

.archived-form-latest {
  background: linear-gradient(135deg, rgba(194, 117, 94, 0.05) 0%, rgba(194, 117, 94, 0.1) 100%);
  border-color: var(--terracotta-light);
}

.archived-form-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.archived-form-org {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archived-form-date {
  font-size: 12px;
  color: var(--text-light);
}

.archived-form-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--terracotta);
  background: rgba(194, 117, 94, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  width: fit-content;
}

.archived-form-actions {
  flex-shrink: 0;
}

.archived-form-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.archived-form-actions .btn svg {
  flex-shrink: 0;
}

/* Mobile responsive for archived forms */
@media (max-width: 500px) {
  .archived-form-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .archived-form-actions {
    width: 100%;
  }

  .archived-form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   MOBILE-FRIENDLY REDESIGN
   All styles below are mobile-only and don't affect desktop
   ========================================================================== */

/* Hide mobile elements on desktop */
.mobile-menu-btn,
.mobile-overlay {
  display: none;
}

/* ==========================================================================
   Mobile Styles (768px and below)
   ========================================================================== */
@media (max-width: 768px) {

  /* Mobile Menu Button - Floating pill on left side */
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: fixed;
    left: -24px;
    /* Use svh (small viewport height) so position doesn't jump when browser UI hides/shows */
    top: 50svh;
    transform: translateY(-50%);
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(196, 120, 90, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Only transition transform and box-shadow, not position (prevents jitter when mobile address bar shows/hides) */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-menu-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 24px rgba(196, 120, 90, 0.5), 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .mobile-menu-btn:active {
    transform: translateY(-50%) scale(0.95);
  }

  /* Hamburger lines */
  .hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Animate to X when open */
  .mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Mobile Overlay - Semi-transparent backdrop with blur */
  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 55, 40, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Index Sidebar - Slide-out drawer */
  .index {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 24px 20px;
    background: linear-gradient(180deg, rgb(255, 251, 247) 0%, rgb(245, 230, 211) 100%);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 20px 20px 0;
    /* Styled scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 160, 140, 0.5) transparent;
  }

  /* WebKit scrollbar styling for sidebar */
  .index::-webkit-scrollbar {
    width: 6px;
  }

  .index::-webkit-scrollbar-track {
    background: transparent;
  }

  .index::-webkit-scrollbar-thumb {
    background: rgba(180, 160, 140, 0.5);
    border-radius: 3px;
  }

  .index::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 160, 140, 0.7);
  }

  .index.mobile-open {
    transform: translateX(0);
  }

  /* Close hint at top of drawer */
  .index::before {
    content: 'Tik buiten menu om te sluiten';
    display: block;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    padding: 8px 0 16px;
    margin: -8px -20px 12px;
    border-bottom: 1px solid rgba(180, 160, 140, 0.3);
    opacity: 0.7;
  }

  /* Hide highlighter on mobile - use simple backgrounds instead */
  .mobile-highlighter {
    display: none;
  }

  /* Reset desktop outcrop padding on mobile */
  .index {
    padding-left: 20px;
  }

  /* Make index items more touch-friendly */
  .index-item {
    padding: 14px 16px;
    margin-bottom: 6px;
    min-height: 48px;
    border-radius: 12px;
  }

  .index-item .label {
    font-size: 14px;
    transform: none; /* Reset desktop transform */
  }

  .index-item .status {
    width: 24px;
    height: 24px;
    font-size: 11px;
    transform: none; /* Reset desktop transform */
  }

  /* Simple background highlighting on mobile */
  .index-item.active {
    background: rgba(255, 255, 255, 0.7);
  }

  .index-item.active .status {
    transform: none; /* No outcrop on mobile */
  }

  .index-item:hover {
    background: rgba(255, 255, 255, 0.5);
  }

  .index-divider {
    padding: 16px 16px 8px;
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
    font-size: 11px;
  }

  .index-divider-clickable {
    padding: 14px 16px;
    margin-left: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Simple background on active dividers for mobile */
  .index-divider-clickable.active {
    background: rgba(255, 255, 255, 0.7);
  }

  /* Progress bar in drawer */
  .progress-bar-container {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .progress-bar {
    height: 10px;
  }

  .progress-percentage {
    font-size: 14px;
    min-width: 42px;
  }

  /* Org info at bottom of drawer */
  .org-info {
    margin-top: auto;
    padding-top: 16px;
  }

  .logout-btn {
    font-size: 14px;
    padding: 8px 0;
  }

  /* Main container adjustments */
  .survey-body {
    padding: 16px 12px;
  }

  .container {
    flex-direction: column;
    border-radius: 16px;
    min-height: auto;
    /* Remove backdrop-filter to prevent stacking context that traps sidebar z-index */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Update pseudo-element border-radius to match */
  .container::before {
    border-radius: calc(16px + var(--outline-width));
  }

  /* Content area - full width on mobile */
  .content {
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .content-header {
    display: none; /* Hide header on mobile - using drawer instead */
  }

  .content-scrollable {
    max-height: none; /* No height limit on mobile - page scrolls naturally */
    overflow: visible;
    padding: 0;
    margin: 0;
  }

  .content-footer {
    margin-top: 24px;
  }

  /* Hide progress dots at top on mobile - we have the drawer */
  .progress-dots-top-container {
    display: none;
  }

  /* Top bar adjustments */
  /* Hide top navigation on mobile - using fixed bottom nav instead */
  .top-bar {
    display: none;
  }

  /* Headings */
  h1 {
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1.25;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Buttons - larger touch targets */
  .btn {
    padding: 14px 24px;
    font-size: 15px;
    min-height: 48px;
    border-radius: 12px;
  }

  .btn-small {
    padding: 12px 18px;
    font-size: 14px;
    min-height: 44px;
  }

  /* Fixed bottom navigation bar for thumb comfort */
  .nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255, 251, 247, 0.95) 0%, rgba(245, 230, 211, 0.98) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(180, 160, 140, 0.2);
  }

  .nav-buttons .btn {
    flex: 1;
    min-height: 50px;
    font-size: 16px;
    font-weight: 600;
  }

  /* Reset scrollable on mobile - page scrolls normally */
  .content-scrollable {
    max-height: none;
    overflow: visible;
  }

  /* Form fields - larger touch targets */
  .field {
    margin-bottom: 24px;
  }

  .field label {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .field input[type="text"],
  .field input[type="number"],
  .field input[type="date"],
  .field input[type="email"],
  .field input[type="password"],
  .field textarea,
  .field select {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 12px;
  }

  /* Option cards - more touch-friendly */
  .option-card {
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: 14px;
    min-height: 60px;
  }

  .option-radio {
    width: 24px;
    height: 24px;
  }

  .option-card.selected .option-radio::after {
    width: 12px;
    height: 12px;
  }

  .option-content h3 {
    font-size: 15px;
  }

  .option-content p {
    font-size: 13px;
  }

  /* Conditional fields */
  .conditional {
    margin-left: 24px;
    padding: 18px 16px;
    width: calc(100% - 24px);
    border-radius: 0 14px 14px 0;
  }

  /* ==========================================================================
     Mobile Likert Scale - Card-based with Segmented Controls
     Best practice for mobile survey forms
     ========================================================================== */

  .likert-table {
    display: block;
    margin: 0 0 20px;
    border-collapse: separate;
  }

  /* Hide the table header on mobile - we'll show labels in segmented control */
  .likert-table thead {
    display: none;
  }

  .likert-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Each row becomes a card */
  .likert-table tbody tr {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--sand);
    opacity: 1;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .likert-table tbody tr:not(.answered) {
    opacity: 0.9;
  }

  .likert-table tbody tr.answered {
    border-color: var(--terracotta);
    box-shadow: 0 2px 8px rgba(196, 120, 90, 0.15);
  }

  /* Statement text - first cell */
  .likert-table tbody td:first-child {
    display: block;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    padding: 0 32px 14px 0;
    border: none;
    font-weight: 500;
  }

  .likert-table tbody td:first-child .q-num {
    color: var(--terracotta);
    font-weight: 700;
    margin-right: 6px;
  }

  /* Hide radio cells, we'll use labels instead */
  .likert-table tbody td:not(:first-child) {
    display: none;
  }

  /* Hide desktop checkmark on mobile - replaced by reset button */
  .likert-table tbody tr.answered::after {
    display: none;
  }

  /* Bouncing arrow for unfilled rows - mobile position */
  .likert-table.has-missing tbody tr:not(.answered)::after {
    right: 12px;
    top: 14px;
    transform: none;
    font-size: 22px;
  }

  @keyframes arrow-bounce {
    0%, 100% {
      transform: translateX(0px);
      opacity: 0.5;
    }
    50% {
      transform: translateX(-3px);
      opacity: 0.7;
    }
  }

  /* Hide the reset button on mobile - cleaner experience */
  .likert-header .reset-btn {
    display: none;
  }

  /* Segmented control for Likert options */
  .likert-segment {
    position: relative;
    display: flex;
    width: 100%;
    background: var(--sand);
    border-radius: 10px;
    padding: 4px;
    gap: 0;
  }

  /* Sliding indicator background */
  .likert-segment-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(25% - 2px);
    height: calc(100% - 8px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
  }

  .likert-segment-slider.no-transition {
    transition: none;
  }

  .likert-segment.has-selection .likert-segment-slider {
    opacity: 1;
  }

  .likert-segment.is-dragging .likert-segment-slider {
    transition: transform 0.1s ease-out;
  }

  .likert-segment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
  }

  /* Subtle fill for unselected options when no selection yet */
  .likert-segment:not(.has-selection) .likert-segment-option {
    background: rgba(255, 255, 255, 0.5);
    margin: 0 2px;
  }

  .likert-segment:not(.has-selection) .likert-segment-option:first-of-type {
    margin-left: 0;
  }

  .likert-segment:not(.has-selection) .likert-segment-option:last-of-type {
    margin-right: 0;
  }

  .likert-segment-option:active {
    transform: scale(0.96);
  }

  .likert-segment:not(.has-selection) .likert-segment-option:active {
    background: rgba(255, 255, 255, 0.8);
  }

  /* Selected option text styling */
  .likert-segment-option.selected .likert-segment-label {
    color: var(--terracotta);
    font-weight: 600;
  }

  /* Hover state during drag */
  .likert-segment-option.hover .likert-segment-label {
    color: var(--terracotta);
    font-weight: 600;
  }

  .likert-segment-label {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
  }

  /* Likert header with scale legend on mobile */
  .likert-scale-legend {
    display: flex;
    justify-content: space-between;
    padding: 0 8px 12px;
    font-size: 11px;
    color: var(--text-light);
  }

  .likert-scale-legend span {
    opacity: 0.7;
  }

  /* Section headers */
  .section-header {
    padding: 14px 16px;
    margin: 24px -16px 18px;
    border-radius: 0;
    font-size: 14px;
  }

  /* Question groups */
  .question-group {
    padding: 18px 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
  }

  /* Info boxes */
  .info-box {
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    border-radius: 0 12px 12px 0;
  }

  .info-box-large {
    padding: 20px 20px;
  }

  /* Answer categories box */
  .answer-categories-box {
    padding: 20px;
    border-radius: 14px;
  }

  .answer-categories-box h3 {
    font-size: 17px;
  }

  .answer-categories-list li {
    padding: 14px 18px;
    font-size: 15px;
  }

  /* Bottom bar */
  .bottom-bar {
    margin-top: 20px;
    padding-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Progress dots at bottom */
  .progress-dots-bottom-container {
    padding: 16px 0 8px;
  }

  .progress-dots span {
    width: 10px;
    height: 10px;
  }

  .progress-dots span.active {
    width: 28px;
  }

  /* Success page */
  .success {
    padding: 40px 20px;
  }

  .success-icon {
    width: 70px;
    height: 70px;
  }

  .success-icon svg {
    width: 36px;
    height: 36px;
  }

  /* Review step */
  .review-item-header {
    padding: 14px 16px;
  }

  .review-item-content.open {
    padding: 18px 16px;
  }

  .btn-review-goto {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Comments section */
  .comments-section {
    margin-top: 20px;
    padding-top: 14px;
  }

  .comments-toggle {
    padding: 8px 0;
  }

  /* Multi-input groups */
  .multi-input-group {
    gap: 14px;
  }

  .multi-input-group input {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Checkbox labels */
  .checkbox-label {
    font-size: 14px;
    padding: 8px 0;
  }

  .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  /* Question numbers */
  .q-num {
    font-size: 13px;
  }

  /* Reset buttons */
  .reset-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* Print button - hide on mobile */
  .btn-print {
    display: none;
  }
}

/* ==========================================================================
   Extra Small Mobile (< 400px)
   ========================================================================== */
@media (max-width: 400px) {
  .mobile-menu-btn {
    left: -22px;
    width: 44px;
    height: 44px;
  }

  .hamburger-line {
    width: 18px;
  }

  .survey-body {
    padding: 12px 8px;
  }

  .content-scrollable {
    max-height: none;
    overflow: visible;
  }

  h1 {
    font-size: 20px;
  }

  .option-card {
    padding: 14px 14px;
  }

  .index {
    width: 260px;
  }

  .btn {
    padding: 12px 20px;
  }

  .btn-small {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Likert cards - extra small screens */
  .likert-table tbody td:first-child {
    font-size: 13px;
    padding: 0 0 12px 0;
  }

  .likert-table tbody tr {
    padding: 14px;
  }

  .likert-segment-option {
    padding: 10px 2px;
    min-height: 48px;
  }

  .likert-segment-label {
    font-size: 10px;
  }
}

/* ==========================================================================
   Prevent body scroll when drawer is open
   ========================================================================== */
body.mobile-drawer-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ==========================================================================
   Decorative Logo Shapes - Background Elements
   ========================================================================== */

/* Container for decorative elements - fixed positioning */
.logo-decor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Gentle floating animations - serene blob-like paths */
@keyframes float-1 {
  0%, 100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(15px, -20px);
  }
  40% {
    transform: translate(-10px, -13px);
  }
  60% {
    transform: translate(-20px, 10px);
  }
  80% {
    transform: translate(8px, 15px);
  }
}

@keyframes float-2 {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-18px, -10px);
  }
  50% {
    transform: translate(13px, -23px);
  }
  75% {
    transform: translate(-8px, 13px);
  }
}

@keyframes float-3 {
  0%, 100% {
    transform: translate(0, 0);
  }
  30% {
    transform: translate(13px, 18px);
  }
  60% {
    transform: translate(-15px, -8px);
  }
}

/* The complete logo shape (person + chevron as one unit) */
.logo-decor-shape {
  position: absolute;
  width: 450px;
  height: 520px;
  opacity: 0.18;
}

.logo-decor-shape svg {
  width: 100%;
  height: 100%;
}

/* Bottom-left positioning - logo peeking up from corner */
.logo-decor-bottom-left {
  bottom: -180px;
  left: -120px;
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(135deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  animation: float-1 20s ease-in-out infinite;
}

/* Top-right positioning - logo peeking from corner */
.logo-decor-top-right {
  top: -200px;
  right: -140px;
  -webkit-mask-image: linear-gradient(315deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(315deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  animation: float-2 25s ease-in-out infinite;
}

/* Center-right positioning - third decorative element */
.logo-decor-center-right {
  top: 50%;
  right: -200px;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
  animation: float-3 22s ease-in-out infinite;
}

/* Login page specific - larger and more visible */
body:not(.survey-body) .logo-decor-shape {
  width: 550px;
  height: 640px;
  opacity: 0.2;
}

body:not(.survey-body) .logo-decor-bottom-left {
  bottom: -220px;
  left: -140px;
}

body:not(.survey-body) .logo-decor-top-right {
  top: -240px;
  right: -160px;
}

body:not(.survey-body) .logo-decor-center-right {
  width: 400px;
  height: 460px;
  right: -180px;
  opacity: 0.12;
}

/* Smaller on mobile screens */
@media (max-width: 600px) {
  .logo-decor-shape {
    width: 320px;
    height: 370px;
    opacity: 0.16;
  }

  .logo-decor-bottom-left {
    bottom: -130px;
    left: -90px;
  }

  .logo-decor-top-right {
    top: -140px;
    right: -100px;
  }

  .logo-decor-center-right {
    display: none;
  }
}

/* Hide decorations when printing */
@media print {
  .logo-decor {
    display: none !important;
  }
}

/* ==========================================================================
   Word Counter
   ========================================================================== */

.word-counter {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

.word-counter .hint-success {
  color: #2e7d32;
  font-weight: 500;
}

.word-counter .hint-error {
  color: var(--error);
  font-weight: 500;
}

/* Contenteditable field (textarea replacement for word limit styling) */
.contenteditable-wrapper {
  position: relative;
}

.contenteditable-field {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  background: var(--cream-light);
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  color: var(--text);
  transition: all 0.2s;
  overflow-y: auto;
  resize: vertical;
}

.contenteditable-field:focus {
  outline: none;
  border-color: var(--salmon);
  background: var(--cream);
}

.contenteditable-field:empty::before {
  content: attr(data-placeholder);
  color: var(--text-light);
  opacity: 0.6;
  pointer-events: none;
}

.contenteditable-field .word-excess {
  color: var(--error);
  font-weight: 600;
}

/* Textarea word counters (toelichting, motivatie, comments) */
.textarea-word-counter {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}
