/* ==========================================================================
   CPG ADHD COURSE 2026 - TYPOGRAPHY & DESIGN SYSTEM IMPROVEMENTS
   Typography Pairings:
   - Heading: 'Nunito' (Friendly, soft-rounded, high warmth & legibility)
   - Body: 'Plus Jakarta Sans' (Modern geometric, crisp, high-aperture legibility)
   - Accents / Focus Badges: 'Lexend' (Cognitive-friendly, engineered for ADHD visual scanning)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700;800&family=Nunito:wght@700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --secondary: #10b981;
  --secondary-light: #ecfdf5;
  --amber: #f59e0b;
  --amber-light: #fffbe6;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --pink: #ec4899;
  --dark: #0f172a;
  --text-muted: #64748b;
  --border-light: rgba(226, 232, 240, 0.8);
  
  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #fef3c7 100%);
  --card-bg: rgba(255, 255, 255, 0.94);
  --glass-shadow: 0 20px 40px -15px rgba(14, 165, 233, 0.15), 0 0 15px rgba(255, 255, 255, 0.5) inset;
  --glow-border: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(16, 185, 129, 0.4), rgba(245, 158, 11, 0.4));
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  
  /* ENHANCED TYPOGRAPHY SYSTEM */
  --font-heading: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-alt: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* CALM / SENSORY-FRIENDLY THEME OVERRIDE */
body.calm-mode {
  --bg-gradient: #f1f5f9;
  --card-bg: #ffffff;
  --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --glow-border: #cbd5e1;
}

body.calm-mode * {
  animation: none !important;
  transition: background-color 0.15s, color 0.15s !important;
}

/* BASE RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  min-height: 100vh;
  background: var(--bg-gradient);
  background-image: url('assets/cartoon_bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem;
  position: relative;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* FLOATING CARTOON DECORATION BUBBLES */
.cartoon-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: floatUp 12s infinite linear;
}

.bubble-1 { width: 80px; height: 80px; left: 5%; bottom: -100px; animation-delay: 0s; }
.bubble-2 { width: 120px; height: 120px; left: 88%; bottom: -120px; animation-delay: 3s; }
.bubble-3 { width: 50px; height: 50px; left: 15%; bottom: -60px; animation-delay: 6s; }
.bubble-4 { width: 90px; height: 90px; left: 75%; bottom: -90px; animation-delay: 2s; }

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* MAIN APPLICATION CONTAINER */
.app-container {
  width: 100%;
  max-width: 860px;
  position: relative;
  z-index: 10;
}

/* TOP BRANDING BAR & CONTROLS */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hospital-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  border: 2px solid #e0f2fe;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  gap: 0.6rem;
}

.btn-pill {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--border-light);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-family: var(--font-alt);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.btn-pill:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
}

/* FANCY GLASS CARD */
.fancy-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--glass-shadow);
  border: 3px solid rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.fancy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b, #ec4899, #8b5cf6);
}

/* HEADER WITH MASCOT */
.course-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px dashed rgba(203, 213, 225, 0.7);
  margin-bottom: 1.75rem;
}

.mascot-avatar {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  overflow: hidden;
  border: 4px solid #ffffff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.22);
  flex-shrink: 0;
  background: #eff6ff;
  animation: floatMascot 4s ease-in-out infinite;
}

@keyframes floatMascot {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

.mascot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-content h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.65rem;
  color: #1e3a8a;
  line-height: 1.25;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.header-content .subtitle {
  color: var(--primary);
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.meta-item {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.35rem 0.8rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* STEP PROGRESS BAR */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 35px;
  right: 35px;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.progress-fill {
  position: absolute;
  top: 20px;
  left: 35px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 2;
  transition: width 0.4s ease;
  width: 0%;
  border-radius: 4px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 3;
  cursor: pointer;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.progress-step.active .step-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.progress-step.completed .step-icon {
  border-color: var(--secondary);
  background: var(--secondary);
  color: #ffffff;
}

.step-label {
  font-family: var(--font-alt);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.progress-step.active .step-label {
  color: var(--primary);
}

/* STEP CONTENT PANELS */
.wizard-step {
  display: none;
  animation: fadeInStep 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.step-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: #1e293b;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* FORM FIELDS & CARDS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.full-width {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-label .required {
  color: var(--pink);
}

.input-wrapper {
  position: relative;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  color: var(--dark);
  transition: all 0.2s ease;
  min-height: 46px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

/* OPTION CARDS */
.radio-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.radio-card-label, .checkbox-card-label {
  position: relative;
  cursor: pointer;
  display: block;
}

.radio-card-label input[type="radio"],
.checkbox-card-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-card {
  padding: 0.9rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  min-height: 60px;
}

.option-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.option-icon {
  font-size: 1.3rem;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-text strong {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark);
}

.option-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.radio-card-label input:checked + .option-card,
.checkbox-card-label input:checked + .option-card {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.radio-card-label input:checked + .option-card .option-icon {
  background: var(--primary);
  color: #ffffff;
}

/* WIZARD BUTTON BAR */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 2px dashed rgba(203, 213, 225, 0.7);
  gap: 0.8rem;
}

.btn-fancy {
  padding: 0.75rem 1.6rem;
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-height: 46px;
  letter-spacing: 0.02em;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--dark);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.btn-submit {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}

/* SUMMARY REVIEW BOX */
.review-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.88rem;
  gap: 0.5rem;
}

.review-item:last-child {
  border-bottom: none;
}

.review-key {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.review-val {
  font-weight: 700;
  color: var(--dark);
  text-align: right;
  word-break: break-word;
}

/* TICKET CONTAINER */
.ticket-container {
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  border: 3px solid #3b82f6;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}

.ticket-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ticket-badge {
  background: #10b981;
  color: #ffffff;
  font-family: var(--font-alt);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  letter-spacing: 1px;
}

.ticket-id {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.65rem;
  color: var(--primary);
  letter-spacing: 1px;
}

/* DRAFT SAVE TOAST */
.draft-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.draft-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* MOBILE RESPONSIVE MEDIA QUERIES */
@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem;
  }

  .fancy-card {
    padding: 1.5rem 1rem;
    border-radius: 18px;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .course-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    align-items: center;
  }

  .mascot-avatar {
    width: 80px;
    height: 80px;
    border-radius: 18px;
  }

  .header-content h1 {
    font-size: 1.3rem;
  }

  .course-meta {
    justify-content: center;
  }

  .wizard-progress::before, .progress-fill {
    left: 20px;
    right: 20px;
  }

  .step-icon {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .step-label {
    font-size: 0.72rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .full-width {
    grid-column: span 1;
  }

  .radio-card-grid {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    flex-direction: column-reverse;
    gap: 0.8rem;
  }

  .btn-fancy {
    width: 100%;
  }

  .review-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .review-val {
    text-align: left;
  }
}

@media (max-width: 380px) {
  .header-content h1 {
    font-size: 1.15rem;
  }
  
  .step-label {
    display: none;
  }

  .wizard-progress::before, .progress-fill {
    top: 17px;
  }
}
