:root{
  --primary:#6C5CE7;
  --secondary:#00CEC9;
  --accent:#FD79A8;
  --bg:#F0F3F7;
  --card-bg:#FFFFFF;
  --text:#2D3436;
  --text-light:#636E72;
  --success:#00B894;
  --radius:16px;
  --shadow:0 10px 20px rgba(0,0,0,0.06);
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body{
  margin:0;
  padding:0;
  min-height:100vh;
  background: var(--bg);
  color: var(--text);
  line-height:1.5;
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  display:flex;
  flex-direction:column;
  overflow-x:hidden;
}

/* ---------- Baby Chaos background ---------- */
#babyChaos{
  position:fixed;
  inset:0;
  overflow:hidden;
  pointer-events:none;
  z-index:0;
  filter: saturate(1.05);
}

#babyChaos .floater{
  position:absolute;
  bottom:-40px;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  transform: translateX(0);
  will-change: transform, opacity;
}

@keyframes floatUp{
  0%   { transform: translateX(0) translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  60%  { transform: translateX(var(--drift)) translateY(-60vh); }
  100% { transform: translateX(calc(var(--drift) * -1)) translateY(-115vh); opacity: 0; }
}

/* ---------- Layout ---------- */
.container{
  width:100%;
  max-width: 620px;
  margin:0 auto;
  padding: 22px 18px 120px;
  position:relative;
  z-index:1;
}

h1,h2{
  font-family:'Fredoka', system-ui, sans-serif;
  margin:0 0 0.8rem 0;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.text-center{ text-align:center; }
.hidden{ display:none !important; }

header p{
  margin:0.25rem 0 0;
  color: var(--text-light);
}

/* ---------- Cards + step transitions ---------- */
.card{
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(0,0,0,0.03);
  position:relative;
}

.step-content{ display:none; }
.step-content.active{
  display:block;
  animation: slideIn 260ms ease-out;
}

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

/* Card pop + sparkle */
.card.pop{
  animation: cardPop 320ms cubic-bezier(.2,1.2,.2,1);
}
@keyframes cardPop{
  0% { transform: translateY(6px) scale(0.985); }
  100% { transform: translateY(0) scale(1); }
}
.card.pop::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(circle at 18% 22%, rgba(253,121,168,0.18), transparent 38%),
    radial-gradient(circle at 82% 18%, rgba(0,206,201,0.14), transparent 42%),
    radial-gradient(circle at 70% 82%, rgba(108,92,231,0.12), transparent 40%);
  opacity:0;
  animation: sparkle 520ms ease-out;
  pointer-events:none;
}
@keyframes sparkle{
  0%{ opacity:0; transform: scale(0.98); }
  45%{ opacity:1; }
  100%{ opacity:0; transform: scale(1); }
}

/* ---------- Form elements (bouncy) ---------- */
label{
  display:block;
  font-weight: 800;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.hint{
  font-size:0.9rem;
  color: var(--text-light);
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], select{
  width:100%;
  padding: 12px 16px;
  border:2px solid #DFE6E9;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  transition: border-color 150ms ease, transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  background: #FAFAFA;
    -webkit-box-sizing: border-box;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  display: block;
}

input:focus, select:focus{
  outline:none;
  border-color: var(--primary);
  background:#fff;
  transform: translateY(-1px); /* removed scale */
  box-shadow: 0 10px 24px rgba(108,92,231,0.16);
}

/* Make date/time match the other fields visually */
input[type="date"],
input[type="time"]{
  height: 48px;          /* matches your padding look */
  line-height: 48px;
}



/* invalid fields */
.is-invalid{
  border-color: #ff7675 !important;
  box-shadow: 0 10px 24px rgba(255,118,117,0.20) !important;
  background: #fff7f7 !important;
}

/* little “boop” helper */
.boop{
  animation: boop 220ms ease-out;
}
@keyframes boop{
  0%{ transform: scale(1); }
  55%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}

/* ---------- Radio cards ---------- */
.radio-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.radio-card{ position:relative; }
.radio-card input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.radio-card-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:0.35rem;
  background:#fff;
  border:2px solid #DFE6E9;
  border-radius: 14px;
  padding: 1rem;
  cursor:pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
  text-align:center;
  user-select:none;
}

.radio-card:hover .radio-card-inner{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.radio-card input:checked ~ .radio-card-inner{
  border-color: var(--primary);
  background: #EEF2FF;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(108,92,231,0.18);
}

.radio-card.invalid .radio-card-inner{
  border-color:#ff7675;
  background:#fff7f7;
  animation: nudge 260ms ease-out;
}
@keyframes nudge{
  0%{ transform: translateX(0); }
  35%{ transform: translateX(-6px); }
  70%{ transform: translateX(6px); }
  100%{ transform: translateX(0); }
}

.emoji{ font-size: 2rem; line-height:1; }

/* ---------- Steppers ---------- */
.stepper{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#FAFAFA;
  border-radius: 14px;
  padding: 0.55rem;
  margin-bottom: 1.2rem;
  border: 2px solid #DFE6E9;
}

.stepper-btn{
  background: var(--primary);
  color:#fff;
  border:none;
  width:42px;
  height:42px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor:pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
.stepper-btn:active{ transform: scale(0.94); }
.stepper-val{
  font-size: 1.2rem;
  font-weight: 900;
  width: 64px;
  text-align:center;
}

/* ---------- Bottom Nav + progress meter ---------- */
.nav-bar{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:100;
  padding: 12px 14px 14px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 -14px 40px rgba(0,0,0,0.06);
}

.nav-inner{
  max-width: 820px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr minmax(240px, 2fr) 1fr;
  gap: 12px;
  align-items:center;
}

.btn{
  padding: 12px 18px;
  border-radius: 999px;
  border:none;
  font-weight: 900;
  font-size: 1rem;
  cursor:pointer;
  transition: transform 120ms ease, opacity 160ms ease, filter 160ms ease;
  font-family: inherit;
}
.btn:active{ transform: scale(0.96); }
.btn:disabled{ opacity:0.5; cursor:not-allowed; }
.btn-primary{ background: var(--primary); color:#fff; }
.btn-secondary{ background: #DFE6E9; color: var(--text); }

/* Stork progress meter */
.stork-meter{
  display:flex;
  flex-direction:column;
  gap: 8px;
  align-items:stretch;
}

.stork-track{
  height: 16px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  position:relative;
  overflow:hidden;
}

.stork-fill{
  height:100%;
  width:0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
  transition: width 260ms ease;
}

.stork{
  position:absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  display:grid;
  place-items:center;
  transition: left 260ms ease;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.12));
}

.stork svg{
  width: 44px;
  height: 44px;
}

.stork-wiggle{
  animation: wiggle 320ms ease-out;
}
@keyframes wiggle{
  0%{ transform: translate(-50%,-50%) rotate(0deg); }
  35%{ transform: translate(-50%,-50%) rotate(-7deg); }
  70%{ transform: translate(-50%,-50%) rotate(6deg); }
  100%{ transform: translate(-50%,-50%) rotate(0deg); }
}

.stork-label{
  display:flex;
  justify-content:space-between;
  font-weight: 900;
  font-size: 0.92rem;
  color: var(--text-light);
}

.status-text{
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.75);
  border: 1px dashed rgba(108,92,231,0.25);
}

.status-snark{
  color: var(--text-light);
  font-weight: 800;
  margin-left: 6px;
}

.status-pop{
  animation: statusPop 240ms ease-out;
}
@keyframes statusPop{
  0%{ transform: translateY(2px); opacity: 0.65; }
  100%{ transform: translateY(0); opacity: 1; }
}

/* Burst */
.burst{
  position:absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 2;
  display:flex;
  gap: 10px;
  opacity: 0;
  pointer-events:none;
  animation: burst 620ms ease-out;
}
.burst span{
  font-size: 18px;
  animation: drift 620ms ease-out;
}
@keyframes burst{
  0%{ opacity:0; transform: translateX(-50%) translateY(6px) scale(0.95); }
  35%{ opacity:1; }
  100%{ opacity:0; transform: translateX(-50%) translateY(-14px) scale(1.02); }
}
@keyframes drift{
  0%{ transform: translateY(0) rotate(0deg); }
  100%{ transform: translateY(-18px) rotate(18deg); }
}

/* Confetti canvas */
.confetti-canvas{
  position:fixed;
  top:0; left:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:999;
}

/* Responsive nav */
@media (max-width: 640px){
  .nav-inner{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .btn{ width:100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -----------------------------
   Baby icon + speech bubble (aligned)
------------------------------ */

.stork-rail{
  position: relative;
  width: 100%;
  padding-top: 56px; /* space for bubble */
}

.stork-track{
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}

.stork-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
  transition: width 260ms ease;
}

/* The moving icon */
.stork{
  position: absolute;
  top: 56px; /* visually centered with track below bubble */
  left: 0%;
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: left 260ms ease;
  pointer-events: none;
}

.stork-badge{
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.08);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
}

.baby-icon{
  font-size: 26px;
  line-height: 1;
  transform: translateY(1px); /* tiny optical adjustment */
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.12));
}

/* Bubble always positioned by JS to point at the icon */
/* Update this section in style.css */
/* Bubble */
.stork-bubble{
  position: absolute;
  top: 0;
  left: 0;                 /* JS sets this */
  transform: translateX(-50%);
  z-index: 6;

  width: max-content;
  max-width: min(340px, calc(100vw - 32px));

  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(108,92,231,0.22);
  box-shadow: 0 14px 32px rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 8px 10px;

  font-weight: 900;
  font-size: 0.9rem;
  line-height: 1.2;

  transition: left 260ms ease, opacity 200ms ease, transform 200ms ease;

  --tail-x: 50%;
  will-change: left;
}

/* Tail = border triangle behind + fill triangle on top */
.stork-bubble::before,
.stork-bubble::after{
  content:"";
  position:absolute;
  left: var(--tail-x);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

/* border */
.stork-bubble::before{
  bottom: -11px;
  border-top: 11px solid rgba(108,92,231,0.22);
}

/* fill */
.stork-bubble::after{
  bottom: -10px;
  border-top: 10px solid rgba(255,255,255,0.96);
}


.bubble-pop{ animation: bubblePop 220ms ease-out; }
@keyframes bubblePop{
  0%{ transform: translateX(-50%) translateY(2px) scale(0.985); opacity: 0.75; }
  100%{ transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}


/* -----------------------------
   Bonus modal
------------------------------ */
.bonus-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.bonus-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}

.bonus-card{
  position: relative;
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 16px;
  animation: modalIn 220ms ease-out;
}

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

.bonus-top{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bonus-chip{
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: #EEF2FF;
  color: var(--primary);
  border: 1px solid rgba(108,92,231,0.18);
}

.bonus-x{
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}
.bonus-x:hover{ opacity: 1; }

.bonus-title{
  margin: 6px 0 6px;
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--text);
}

.bonus-sub{
  margin: 0 0 12px;
  color: var(--text-light);
  font-weight: 700;
}

.bonus-choices{
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.bonus-choice{
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 14px;
  border: 2px solid #DFE6E9;
  background: #FAFAFA;
  cursor: pointer;
  font-weight: 900;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.bonus-choice:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.bonus-choice:active{ transform: translateY(0) scale(0.99); }
.bonus-choice strong{ color: var(--primary); }

.bonus-actions{
  display:flex;
  justify-content: flex-end;
  gap: 10px;
}


/* -----------------------------------------------------------
   FIX 1: Fix Bubble Overlap (Update these two classes)
----------------------------------------------------------- */

/* Give the icon room so it doesn't overlap the Step label */
.stork-rail{
  position: relative;
  width: 100%;
  padding-top: 70px;      /* your current bubble space */
  padding-bottom: 18px;   /* NEW: space under the icon */
}

.stork-label{
  margin-top: 6px;        /* NEW: pushes label away from rail */
}


.stork {
  position: absolute;
  /* Re-centered: 84px padding + 9px (half track height) = 93px */
  top: 93px; 
  left: 0%;
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: left 260ms ease;
  pointer-events: none;
}

/* -----------------------------------------------------------
   FIX 2: Mobile Nav Layout (Update the nav section)
----------------------------------------------------------- */

.nav-inner {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  /* Desktop Layout: Back | Meter | Next */
  grid-template-columns: 1fr minmax(240px, 2fr) 1fr;
  grid-template-areas: "prev meter next"; 
  gap: 12px;
  align-items: center;
}

/* Assign Grid Areas */
#prevBtn { grid-area: prev; }
#nextBtn { grid-area: next; }
#storkMeter { grid-area: meter; }

/* Responsive Mobile Layout */
@media (max-width: 640px) {
  .nav-inner {
    /* Switch to 2 columns */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    
    /* Layout: 
       [      Meter      ]
       [ Back ]  [ Next  ] */
    grid-template-areas: 
      "meter meter"
      "prev next";
      
    gap: 16px;
  }
  
  .btn { width: 100%; }
}


/* iOS Safari & Mobile: Date/Time Bold + Alignment Fix */
input[type="date"],
input[type="time"] {
  width: 100%;
  display: block;
  -webkit-box-sizing: border-box !important;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  appearance: none;

  /* 1. FORCE DIMENSIONS */
  height: 54px !important;       /* Explicit height matches your text inputs */
  padding: 0 16px !important;    /* Remove top/bottom padding, let line-height center it */
  
  /* 2. MATCH STYLE */
  border: 2px solid #DFE6E9;
  border-radius: 12px;
  background: #FAFAFA;
  
  /* 3. BOLD & CLEAR TYPOGRAPHY */
  font-family: 'Nunito', sans-serif; /* Force your app font */
  font-size: 1rem;
  font-weight: 800;              /* Bold text like the labels */
  color: var(--text);            /* Black text (no iOS blue) */
  line-height: 54px;             /* Matches height for vertical centering */
}

/* 4. THE INTERNAL IOS ALIGNMENT FIX */
/* This aligns the actual text inside the input box on iPhone */
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  display: flex;                 /* Use flexbox inside the input */
  align-items: center;           /* Perfect vertical center */
  height: 100%;                  /* Fill the input height */
  text-align: left;              /* Left align */
  margin: 0;                     /* Remove default margins */
}

/* Focus State */
input[type="date"]:focus,
input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(108,92,231,0.16);
}


/* --- Slimmer, less-cluttered footer/nav --- */
:root{
  --nav-h-pad: 10px;
  --nav-v-pad: 8px;
}

/* Make the footer visually lighter + tighter */
.nav-bar{
  padding: var(--nav-v-pad) var(--nav-h-pad) calc(var(--nav-v-pad) + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 26px rgba(0,0,0,0.05);
}

/* Slightly tighter grid spacing */
.nav-inner{
  gap: 10px;
}

/* Smaller buttons so the questionnaire breathes */
.btn{
  padding: 10px 16px;
  font-size: 0.98rem;
}

/* Shrink the bubble so it doesn’t dominate */
.stork-bubble{
  padding: 8px 10px;
  font-size: 0.9rem;
  border-radius: 12px;
}

/* Slightly smaller progress rail block */
.stork-rail{
  padding-top: 70px; /* was 84px */
}
.stork{
  top: 80px; /* re-center icon relative to the new padding-top */
}

/* Give the page less “reserved” space at the bottom */
.container{
  padding-bottom: 96px; /* was 120px */
}


:root{
  --nav-offset: 120px; /* fallback until JS measures */
}

/* ensure content can scroll above the fixed footer */
.container{
  padding-bottom: calc(var(--nav-offset) + 28px + env(safe-area-inset-bottom)) !important;
}

/* makes scrollIntoView land with space above footer */
html{
  scroll-padding-bottom: calc(var(--nav-offset) + 28px + env(safe-area-inset-bottom));
}

/* helps when focusing/scrolling to cards/fields */
.card{
  scroll-margin-bottom: calc(var(--nav-offset) + 28px + env(safe-area-inset-bottom));
}

