:root {
    --bg: #a8a8a8;
    --card: #fffefe;
    --text: #2c3e50;
    --muted: #34495e;
    --border: #dddddd;
    --shadow: rgba(0, 0, 0, 0.10);

    --primary: #3498db;
    --primaryHover: #2980b9;
    --focus: rgba(52, 152, 219, 0.30);

    --toggleTrack: rgba(0, 0, 0, 0.06);
    --toggleKnob: #9a9a9a;

    --containerEnterY: 10px;
    --containerEnterBlur: 6px;
  }

  body.dark {
    --bg: #0b1220;
    --card: #0f1a2b;
    --text: #e5e7eb;
    --muted: #cbd5e1;
    --border: #26344a;
    --shadow: rgba(0, 0, 0, 0.50);

    --primary: #60a5fa;
    --primaryHover: #3b82f6;
    --focus: rgba(96, 165, 250, 0.25);

    --toggleTrack: rgba(255, 255, 255, 0.10);
    --toggleKnob: #0b1220;
    letter-spacing: 0.15px;
  }

  body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
               
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color .25s ease, color .25s ease;
  }

  .container {
    background-color: var(--card);
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 10px 30px var(--shadow);
    position: relative;
    overflow: hidden;

    opacity: 0;
    transform: translateY(var(--containerEnterY));
    filter: blur(var(--containerEnterBlur));
    transition:
      background-color .25s ease,
      box-shadow .25s ease,
      transform .35s ease,
      opacity .35s ease,
      filter .35s ease;
  }

  /* =========================================================
   Step transition micro-feedback (fade + slight slide)
   ========================================================= */

form,
#reviewPage,
#thankYouPage {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  will-change: opacity, transform;
}

/* When visible (not hidden), animate in */
form:not(.hidden),
#reviewPage:not(.hidden),
#thankYouPage:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}


  .container.ready {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  h1 {
    color: var(--text);
    text-align: center;
    margin: 0 0 24px;
    letter-spacing: 0.2px;
  }

  h2 {
    color: var(--text);
    margin: 0 0 12px;
  }

  .form-group { margin-bottom: 16px; }

  label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: var(--muted);
  }

  input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    background: var(--card);
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .25s ease, color .25s ease;
  }

  input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus);
  }



  /* When we mark a field invalid/valid from JS, we only adjust border/outline.
     This keeps your design consistent and avoids “loud” UI. */
  input.is-invalid,
  select.is-invalid {
    border-color: rgba(220, 38, 38, 0.75); /* red */
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
  }

  input.is-valid,
  select.is-valid {
    border-color: rgba(22, 163, 74, 0.70); /* green */
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.10);
  }



  /* Dark mode tuning (keeps contrast comfortable) */
  body.dark input.is-invalid,
  body.dark select.is-invalid {
    border-color: rgba(248, 113, 113, 0.75);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
  }
  body.dark input.is-valid,
  body.dark select.is-valid {
    border-color: rgba(74, 222, 128, 0.70);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
  }
 

  /* ===== Accessibility / keyboard focus ===== */
  :focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
  }

  /* ===== Optional: First input focus pulse (one-time hint) =====
     This only runs if JS adds the "pulse-once" class to an element. */
  @keyframes focusPulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
    40% { box-shadow: 0 0 0 6px rgba(52, 152, 219, 0.18); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
  }

  .pulse-once {
    animation: focusPulse 700ms ease;
  }

  .hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    line-height: 1.35;
  }

  /* ===== Theme toggle (top-right) ===== */
  .top-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 5;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.25));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 20px var(--shadow);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .15s ease, border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  body.dark .theme-toggle {
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  }

  .theme-toggle:hover { transform: translateY(-1px); border-color: var(--primary); }
  .theme-toggle:active { transform: translateY(0px) scale(0.98); }

  .theme-toggle::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 999px;
    background: var(--toggleTrack);
    z-index: 0;
    transition: background-color .25s ease;
  }

  .theme-toggle > span {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--toggleKnob);
    box-shadow: 0 8px 14px rgba(0,0,0,0.12);
    transition: background-color .25s ease, transform .25s ease;
  }

  body.dark .theme-toggle > span { transform: translateX(-3px); }
  body:not(.dark) .theme-toggle > span { transform: translateX(3px); }

  .theme-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform .25s ease, opacity .2s ease;
    opacity: 1;
  }

  .theme-icon.swap {
    opacity: 0;
    transform: translateY(4px) rotate(-12deg);
  }

  /* ===== Lessons/week card ===== */
  .mini-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: rgba(0,0,0,0.015);
    margin-top: 12px;
  }
  body.dark .mini-card { background: rgba(255,255,255,0.03); }

  .mini-row {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 12px;
    align-items: center;
  }
  @media (max-width: 520px) {
    .mini-row { grid-template-columns: 1fr; }
  }
  .mini-title {
    font-weight: 900;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 4px;
  }

  /* ===== Availability block ===== */
  .availability-block {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: rgba(0,0,0,0.015);
    transition: background-color .25s ease, border-color .25s ease;
    margin-top: 12px;
  }
  body.dark .availability-block { background: rgba(255,255,255,0.03); }

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

  .block-title {
    font-weight: 900;
    color: var(--text);
    font-size: 14px;
  }

  .remove-btn {
  background: transparent;
  color: #b91c1c; /* muted danger red */
  border: 1.5px dashed rgba(185, 28, 28, 0.45);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition:
    color .2s ease,
    border-color .2s ease,
    background-color .2s ease,
    transform .06s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Hover: clearer intent */
.remove-btn:hover {
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.85);
  background: rgba(185, 28, 28, 0.06);
}

/* Active: deliberate press */
.remove-btn:active {
  transform: scale(0.97);
  background: rgba(185, 28, 28, 0.10);
}

/* Dark mode tuning */
body.dark .remove-btn {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}

body.dark .remove-btn:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.9);
  background: rgba(248, 113, 113, 0.10);
}


  /* ===== Compact days grid ===== */
  .days-grid-tight {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
  }

  .days-grid-tight .day-pill:nth-child(5) { grid-column: 1; }
  .days-grid-tight .day-pill:nth-child(6) { grid-column: 2; }
  .days-grid-tight .day-pill:nth-child(7) { grid-column: 3; }

  .day-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0,0,0,0.02);
    transition: background-color .25s ease, border-color .25s ease, transform .06s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px; /* a bit more thumb-friendly by default */
  }

  /* =========================
   Day pill selected state
   ========================= */

/* Default: make transitions smoother for the “pressed” feel */
.day-pill {
  transition:
    background-color .18s ease,
    border-color .18s ease,
    transform .10s ease,
    box-shadow .18s ease,
    color .18s ease;
}

/* Selected pill */
.day-pill.is-selected {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.10), 0 0 0 4px var(--focus);
  transform: scale(1.02);
}

/* Optional: make the label pop slightly when selected */
.day-pill.is-selected span {
  color: var(--text);
}

/* Press interaction (mobile-friendly) */
.day-pill:active {
  transform: scale(0.98);
}
.day-pill.is-selected:active {
  transform: scale(1.00);
}

/* Dark mode tuning (glow can be a bit stronger) */
body.dark .day-pill.is-selected {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), 0 0 0 4px var(--focus);
}


  .day-pill.is-selected {
  border-color: var(--primary);
  background: rgba(52, 152, 219, 0.12);
  transform: translateY(-1px);
}

body.dark .day-pill.is-selected {
  background: rgba(96, 165, 250, 0.18);
}


  body.dark .day-pill { background: rgba(255,255,255,0.04); }
  .day-pill:active { transform: scale(0.99); }

  /* The label becomes the tappable "chip" */
.day-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0,0,0,0.02);
  transition: background-color .2s ease, border-color .2s ease, transform .06s ease, box-shadow .2s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;  /* tighter than before */
}

body.dark .day-pill { background: rgba(255,255,255,0.04); }

.day-pill:active { transform: scale(0.99); }

/* Hide the checkbox square, but keep it accessible and "checked" for JS */
.day-pill input[type="checkbox"]{
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Text tighter */
.day-pill span {
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  line-height: 1;
}

/* Selected (checked) state — modern highlight */
.day-pill:has(input:checked){
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* Keyboard focus */
.day-pill:focus-within{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus);
}


  .day-pill span {
    font-weight: 900;
    font-size: 14px;
    color: var(--text);
    line-height: 1;
  }

  /* ===== Time pickers ===== */
  .time-row {
    display: grid;
    grid-template-columns: 1fr 16px 1fr;
    gap: 10px;
    align-items: end;
    margin-top: 14px;
  }

  .dash {
    text-align: center;
    color: var(--muted);
    font-weight: 900;
    padding-bottom: 10px;
  }

  .time-group label {
    font-weight: 900;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
  }

  textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
  background: var(--card);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .25s ease, color .25s ease;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus);
}


  /* ===== Review list ===== */
  .review-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: rgba(0,0,0,0.015);
    margin-top: 12px;
  }
  body.dark .review-card { background: rgba(255,255,255,0.03); }

  .review-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(127,127,127,0.25);
  }
  .review-row:last-child { border-bottom: none; padding-bottom: 0; }
  .review-row:first-child { padding-top: 0; }

  .review-label {
    color: var(--muted);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
  }

  .review-value {
    color: var(--text);
    font-weight: 900;
    font-size: 14px;
    line-height: 1.3;
  }

  .chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    margin: 4px 6px 0 0;
    font-weight: 900;
    font-size: 13px;
    color: var(--text);
    background: rgba(0,0,0,0.02);
    word-break: keep-all;
  }
  body.dark .chip { background: rgba(255,255,255,0.04); }

  /* ===== Buttons ===== */
  .btn {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: background-color .2s ease, transform .06s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
  }

  .btn-primary:hover { background-color: var(--primaryHover); }
  .btn-primary:active { transform: scale(0.99); }

  .btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
  }

  .btn-secondary:hover { border-color: var(--primary); }
  .btn-secondary:active { transform: scale(0.99); }

  /* ===== Disabled / “locked” buttons =====
     Makes disabled buttons feel clearly inactive and removes hover/active effects.
  */
  .btn:disabled,
  button.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;            /* prevents hover/click interactions */
    transform: none !important;      /* cancels press animation */
    box-shadow: none !important;     /* removes elevation */
    filter: grayscale(0.25) saturate(0.6);
  }

  /* Keep colors stable on disabled (no hover changes) */
  .btn-primary:disabled {
    background-color: var(--primary);
    color: rgba(255, 255, 255, 0.8);
  }

  .btn-secondary:disabled {
    border-color: var(--border);
    color: rgba(0, 0, 0, 0.45);
  }

  /* Dark mode tuning for secondary disabled text */
  body.dark .btn-secondary:disabled {
    color: rgba(255, 255, 255, 0.5);
  }

  .btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;  
    width: 100%;
  }
  @media (max-width: 520px) {
    .btn-row { grid-template-columns: 1fr; }
  }

  .hidden { display: none; }

  .inline-error {
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    background: #ffecec;
    border: 1px solid #f5b5b5;
    color: #a40000;
    font-weight: 900;
    display: none;
  }

  body.dark .inline-error {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.35);
    color: #ffd2d2;
  }

  /* ===== Sending animation ===== */
  .sending {
    pointer-events: none;
    opacity: 0.85;
    position: relative;
  }

  .sending::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.35), rgba(255,255,255,0));
    transform: translateX(-100%);
    animation: shimmer 1.1s linear infinite;
    mix-blend-mode: overlay;
  }

  @keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }

  /* Success check animation */
  .success-wrap {
    display: grid;
    place-items: center;
    margin-top: 18px;
  }


  .check {
    width: 66px;
    height: 66px;
    border-radius: 999px;
    border: 3px solid rgba(127,127,127,0.25);
    display: grid;
    place-items: center;
    animation: pop .35s ease both;
  }

  .check svg {
    width: 34px;
    height: 34px;
    stroke: var(--primary);
    stroke-width: 4.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw .55s ease .15s forwards;
  }

  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }


  /* Thank-you name animation */
.thank-name {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  color: var(--accent-color, #4CAF50); /* fallback if variable missing */
  animation: thankFadeIn 420ms ease-out forwards;
}

@keyframes thankFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


  /* =========================================================
     MOBILE IMPROVEMENTS (added)
     - container padding + typography
     - reserve space for top-right toggle
     - lessons block 1-column earlier
     - days block wraps into 2 columns with bigger targets
     - time pickers stack (no dash)
     - buttons stack on small screens (already) + better touch feel
     ========================================================= */

  /* Slightly earlier single-column for the lessons selector */
  @media (max-width: 600px) {
    .mini-row { grid-template-columns: 1fr; }
    .mini-card { padding: 12px; border-radius: 12px; }
  }

  /* Phone-first tightening + better touch targets */
  @media (max-width: 480px) {
    /* Make overall page feel lighter and avoid cramped look */
    body { padding: 12px; }
    .container { padding: 16px; border-radius: 12px; box-shadow: 0 8px 22px var(--shadow); }

    /* Prevent toggle from visually colliding with title */
    .top-controls { top: 10px; right: 10px; }
    h1 { font-size: 20px; margin-bottom: 16px; padding-top: 36px; }
    h2 { font-size: 18px; }

    /* Slightly larger tap targets in the day pills */
    .days-grid-tight {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }
    .day-pill {
      width: calc(50% - 4px);
      justify-content: flex-start;
      padding: 10px 12px;
      min-height: 44px; /* recommended minimum for touch */
    }

    /* Time selectors should not squeeze */
    .time-row { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
    .dash { display: none; }

    /* Slightly tighter blocks so scrolling feels better */
    .availability-block,
    .review-card { padding: 12px; border-radius: 12px; }

    /* Buttons: keep comfortable */
    .btn { padding: 14px 16px; }
  }

  /* Ultra-small screens: avoid overflow of pill width due to long translations (future-proof) */
  @media (max-width: 360px) {
    .day-pill { width: 100%; }
  }

  /* =========================
     Progress + Draft banner
     ========================= */

  .progress-wrap {
    margin: 6px 0 18px;
  }

  .progress-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
  }

  .progress-step {
    font-weight: 900;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .progress-title {
    font-weight: 900;
    font-size: 13px;
    color: var(--text);
    opacity: 0.95;
    text-align: right;
  }

  .progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border);
  }
  body.dark .progress-bar { background: rgba(255,255,255,0.08); }

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


  /* Draft restore banner */
  .draft-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.02);
    margin: 12px 0 18px;
  }
  body.dark .draft-banner { background: rgba(255,255,255,0.04); }

  .draft-title {
    font-weight: 900;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
  }
  .draft-sub {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
  }

  .draft-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .btn-inline {
    width: auto;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
  }


  /* Mobile tweaks */
  @media (max-width: 480px) {
    .progress-top { flex-direction: column; align-items: flex-start; }
    .progress-title { text-align: left; }

    .draft-banner {
      flex-direction: column;
      align-items: stretch;
    }
    .draft-actions {
      width: 100%;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    .btn-inline { width: 100%; }
  }

  /* =========================================================
   Mobile UX polish for Back / Next / Send buttons
   Add at the VERY BOTTOM of your CSS file
   ========================================================= */

@media (max-width: 520px) {
  /* 1) Make primary action more thumb-friendly and prominent */
  .btn-primary {
    font-size: 17px;
    padding: 16px 18px;
    border-radius: 14px;
  }

  /* Back stays available but less visually dominant */
  .btn-secondary {
    opacity: 0.85;
  }

  /* 2) Ensure primary button is closest to the thumb (bottom) */
  .btn-row {
    display: flex;
    flex-direction: column;
  }

  .btn-row .btn-primary {
    order: 2;
  }

  .btn-row .btn-secondary {
    order: 1;
  }

  /* 3) Make "Send Availability" feel more final */
  #sendAvailabilityBtn {
    margin-top: 18px;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
  }
}

/* Mobile: comfortable form fields + iOS-friendly */
@media (max-width: 520px) {
  input[type="text"], select {
    min-height: 48px;         /* finger-friendly */
    padding: 14px 14px;
    border-radius: 12px;
  }

  /* Better tap behavior on iOS */
  input, select, button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* Mobile: sticky bottom actions */
@media (max-width: 520px) {
  .btn-row,
  .btn { /* covers single-button layouts too */
    scroll-margin-bottom: 90px;
  }

  .btn-row {
    position: sticky;
    bottom: 0;
    background: linear-gradient(
      to top,
      var(--card) 70%,
      rgba(255,255,255,0)
    );
    padding: 12px 0 10px;
    margin-top: 16px;
    z-index: 20;
  }

  body.dark .btn-row {
    background: linear-gradient(
      to top,
      var(--card) 70%,
      rgba(15,26,43,0)
    );
  }
}

/* Mobile: make primary action clearer */
@media (max-width: 520px) {
  .btn-primary {
    font-size: 17px;
    font-weight: 900;
    min-height: 52px;
    border-radius: 14px;
  }

  .btn-secondary {
    min-height: 48px;
    opacity: 0.92;
  }
}

/* =========================================================
   CONFETTI BURST (CSS only)
   Triggered when Thank You page is visible
   ========================================================= */

/* Make sure the Thank You page is the positioning context */
#thankYouPage {
  position: relative;
  overflow: hidden; /* keeps confetti inside the card/page */
}


/* Ensure your visible content stays above confetti */
#thankYouPage > * {
  position: relative;
  z-index: 2;
}

.thank-name {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  color: var(--accent-color, #4CAF50); /* fallback if variable missing */
  animation: thankFadeIn 420ms ease-out forwards;
}

@keyframes thankFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


  /* =========================================================
     MOBILE IMPROVEMENTS (added)
     - container padding + typography
     - reserve space for top-right toggle
     - lessons block 1-column earlier
     - days block wraps into 2 columns with bigger targets
     - time pickers stack (no dash)
     - buttons stack on small screens (already) + better touch feel
     ========================================================= */

  /* Slightly earlier single-column for the lessons selector */
  @media (max-width: 600px) {
    .mini-row { grid-template-columns: 1fr; }
    .mini-card { padding: 12px; border-radius: 12px; }
  }

  /* Phone-first tightening + better touch targets */
  @media (max-width: 480px) {
    /* Make overall page feel lighter and avoid cramped look */
    body { padding: 12px; }
    .container { padding: 16px; border-radius: 12px; box-shadow: 0 8px 22px var(--shadow); }

    /* Prevent toggle from visually colliding with title */
    .top-controls { top: 10px; right: 10px; }
    h1 { font-size: 20px; margin-bottom: 16px; padding-top: 36px; }
    h2 { font-size: 18px; }

    /* Slightly larger tap targets in the day pills */
    .days-grid-tight {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }
    .day-pill {
      width: calc(50% - 4px);
      justify-content: flex-start;
      padding: 10px 12px;
      min-height: 44px; /* recommended minimum for touch */
    }

    /* Time selectors should not squeeze */
    .time-row { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
    .dash { display: none; }

    /* Slightly tighter blocks so scrolling feels better */
    .availability-block,
    .review-card { padding: 12px; border-radius: 12px; }

    /* Buttons: keep comfortable */
    .btn { padding: 14px 16px; }
  }

  /* Ultra-small screens: avoid overflow of pill width due to long translations (future-proof) */
  @media (max-width: 360px) {
    .day-pill { width: 100%; }
  }

  /* =========================
     Progress + Draft banner
     ========================= */

  .progress-wrap {
    margin: 6px 0 18px;
  }

  .progress-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
  }

  .progress-step {
    font-weight: 900;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .progress-title {
    font-weight: 900;
    font-size: 13px;
    color: var(--text);
    opacity: 0.95;
    text-align: right;
  }

  .progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border);
  }
  body.dark .progress-bar { background: rgba(255,255,255,0.08); }

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


  /* Draft restore banner */
  .draft-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.02);
    margin: 12px 0 18px;
  }
  body.dark .draft-banner { background: rgba(255,255,255,0.04); }

  .draft-title {
    font-weight: 900;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
  }
  .draft-sub {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
  }

  .draft-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .btn-inline {
    width: auto;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
  }


  /* Mobile tweaks */
  @media (max-width: 480px) {
    .progress-top { flex-direction: column; align-items: flex-start; }
    .progress-title { text-align: left; }

    .draft-banner {
      flex-direction: column;
      align-items: stretch;
    }
    .draft-actions {
      width: 100%;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    .btn-inline { width: 100%; }
  }

.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.invisible{
  visibility: hidden;
}

