/* ============================================================
   WhatBox — shared styles
   Palette: workshop brown + pegboard cream + safety-orange
   ============================================================ */

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

:root{
  --bg:        #362418;   /* deep workbench brown */
  --bg-2:      #2A1B11;   /* darker recess */
  --panel:     #4B3323;   /* card / box surface */
  --panel-2:   #5B4029;   /* lighter card surface */
  --cream:     #F7F0E4;   /* pegboard cream */
  --cream-dim: #D9C7AE;   /* muted cream */
  --orange:    #EE7B2B;   /* WhatBox orange */
  --orange-2:  #FFA24C;   /* hover / glow */
  --amber:     #C7902E;   /* pegboard tan accent */
  --ink:       #191008;   /* nav / near-black */
  --line:      rgba(247,240,228,0.14);
  --shadow:    0 10px 30px rgba(0,0,0,0.35);

  --font-display: 'Baloo 2', ui-rounded, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --app-max: 480px;
  --nav-h: 72px;
}

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

body{
  background: var(--bg-2);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

/* Phone-frame layout: content column centered, faux "device" edges on wide screens */
.app-shell{
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + 14px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  overflow-x: hidden;
}

@media (min-width: 560px){
  body{
    background:
      radial-gradient(1200px 800px at 50% -10%, #4a3220 0%, #1c1108 70%);
  }
  .app-shell{ box-shadow: var(--shadow); margin-top: 0; }
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
button{ font-family: inherit; }

/* ---------- pegboard texture ---------- */
.pegboard{
  background-image: radial-gradient(var(--cream-dim) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
  opacity: 0.09;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- cardboard box-flap divider (signature shape) ---------- */
.box-divider{
  height: 26px;
  width: 100%;
  background: var(--bg);
  clip-path: polygon(0 0, 8% 100%, 16% 0, 24% 100%, 32% 0, 40% 100%, 48% 0, 56% 100%, 64% 0, 72% 100%, 80% 0, 88% 100%, 96% 0, 100% 100%, 100% 0);
}
.box-divider.flip{ transform: scaleY(-1); }

/* ---------- top bar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 20px 10px;
}
.logo{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.logo .what{ color: var(--cream); }
.logo .box{ color: var(--orange); }

.tagline-block{
  text-align:center;
  padding: 0 20px 6px;
}
.tagline-primary{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--cream);
  margin: 0 0 2px;
}
.tagline-secondary{
  font-size: 12px;
  color: var(--cream-dim);
  margin: 0;
}

.back-link{
  display:flex; align-items:center; gap:6px;
  font-weight:600; font-size:14px; color: var(--cream-dim);
}
.back-link svg{ width:18px; height:18px; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding: 15px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  width:100%;
}
.btn-primary{
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  color: #241206;
  box-shadow: 0 8px 20px rgba(238,123,43,0.35);
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 10px 26px rgba(238,123,43,0.45); }
.btn-primary:active{ transform: translateY(0); }

.btn-ghost{
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--cream);
}
.btn-ghost:hover{ border-color: var(--orange); color: var(--orange-2); }

.btn-store{
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--line);
  justify-content:flex-start;
  padding: 12px 18px;
}
.btn-store .store-icon{ width:28px; height:28px; flex:none; }
.btn-store .store-text{ text-align:left; line-height:1.15; }
.btn-store .store-text small{ display:block; font-size:11px; color: var(--cream-dim); font-weight:500; }
.btn-store .store-text strong{ font-size:16px; font-family: var(--font-display); }

/* ---------- sections ---------- */
.section{ padding: 30px 20px; }
.eyebrow{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--orange-2);
  margin: 0 0 8px;
}
h1.headline{
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--cream);
}
h2.title{
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--cream);
}
p.lede{
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--cream-dim);
  margin: 0 0 22px;
}

/* ---------- cards ---------- */
.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.step-row{
  display:flex; gap:14px; align-items:flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.step-row:last-child{ border-bottom:none; }
.step-num{
  flex: none;
  width: 34px; height:34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--orange-2);
  font-family: var(--font-display);
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  font-size: 15px;
}
.step-copy strong{ display:block; font-size:15px; margin-bottom:2px; color: var(--cream); }
.step-copy span{ font-size:13.5px; color: var(--cream-dim); line-height:1.45; }

.feature-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.feature-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 14px;
}
.feature-card .ic{
  width: 34px; height:34px;
  color: var(--orange);
  margin-bottom: 10px;
}
.feature-card strong{ display:block; font-size:14.5px; margin-bottom:4px; }
.feature-card span{ font-size:12.5px; color: var(--cream-dim); line-height:1.4; }

/* ---------- bottom nav ---------- */
.bottom-nav{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--app-max);
  height: var(--nav-h);
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item{
  flex:1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 4px;
  color: #9C8A76;
  font-size: 11px;
  font-weight: 600;
  transition: color .15s ease;
}
.nav-item svg{ width:23px; height:23px; }
.nav-item.active{ color: var(--orange); }
.nav-item:active{ opacity:0.7; }

/* ---------- forms ---------- */
.field{ margin-bottom: 14px; }
.field label{
  display:block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cream-dim);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.field input{
  width: 100%;
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  color: var(--cream);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.field input::placeholder{ color: #6E5B48; }
.field input:focus{ border-color: var(--orange); background: #201409; }
.field-row{ display:flex; gap:10px; }
.field-row .field{ flex:1; }

.trial-banner{
  display:flex; align-items:center; gap:12px;
  background: linear-gradient(90deg, rgba(238,123,43,0.16), rgba(238,123,43,0.03));
  border: 1px solid rgba(238,123,43,0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.trial-banner .tag{
  flex:none;
  background: var(--orange);
  color: #241206;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}
.trial-banner p{ margin:0; font-size:13px; color: var(--cream); line-height:1.4; }
.trial-banner strong{ color: var(--orange-2); }

.fine-print{
  font-size: 11.5px;
  color: #8C7A66;
  text-align: center;
  line-height: 1.5;
  margin-top: 14px;
}

/* Checkout: Stripe Elements card field, styled to match .field input */
#card-element{
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  transition: border-color .15s ease, background .15s ease;
}
#card-element.StripeElement--focus{ border-color: var(--orange); background: #201409; }
#card-element.StripeElement--invalid{ border-color: #E5484D; }
#card-errors{
  color: #FF8A80;
  font-size: 12.5px;
  margin-top: 8px;
  min-height: 1em;
}
.dev-mode-badge{
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(238,123,43,0.16);
  border: 1px solid rgba(238,123,43,0.4);
  color: var(--orange-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.checkout-summary{
  display:flex; align-items:center; justify-content:space-between;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.checkout-summary .label{ font-size:13px; color: var(--cream-dim); }
.checkout-summary .price{ font-family: var(--font-display); font-size:22px; color: var(--cream); }

/* ---------- doom-scroll feed (Tips / Marketing) ---------- */
.feed-shell{
  height: 100dvh;
  max-width: var(--app-max);
  margin: 0 auto;
  position: relative;
  background: var(--ink);
}
.feed-header{
  position: absolute;
  top: 0; left:0; right:0;
  z-index: 30;
  padding: 16px 18px 40px;
  display:flex; align-items:center; justify-content:space-between;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
  pointer-events:none;
}
.feed-header .logo{ font-size:18px; }
.feed-header .pill{
  pointer-events:all;
  font-size: 11px; font-weight:700;
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
}
.feed{
  height: calc(100dvh - var(--nav-h));
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar{ display:none; }

.reel{
  height: calc(100dvh - var(--nav-h));
  scroll-snap-align: start;
  position: relative;
  display:flex; align-items:flex-end;
  overflow:hidden;
  background-size: cover;
  background-position: center;
}
.reel video{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s ease;
}
.reel.playing video{ opacity:1; }
.reel.playing .reel-poster{ opacity: 0; }
.reel.playing .play-btn{ opacity:0; pointer-events:none; }

.reel-poster{
  position:absolute; inset:0;
  transition: opacity .2s ease;
}
.reel-poster .grad{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.15) 40%, rgba(15,9,4,0.92) 100%);
}
/* Tips page: darken the TOP instead, since the caption sits up there —
   strong coverage through the caption zone (roughly the top 40%), fading
   out below so the rest of the image/video stays clear. */
.reel-poster.grad-top .grad{
  background: linear-gradient(to bottom, rgba(15,9,4,0.88) 0%, rgba(0,0,0,0.35) 22%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0) 55%);
}
.reel-poster .art{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
}
.reel-poster .art svg{ width: 34%; max-width:150px; color: rgba(255,255,255,0.85); }

.play-btn{
  position:absolute; top:50%; left:50%;
  transform: translate(-50%,-50%);
  width: 68px; height:68px;
  border-radius: 50%;
  background: rgba(20,13,7,0.55);
  border: 2px solid rgba(255,255,255,0.85);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition: opacity .2s ease, transform .15s ease;
  z-index: 5;
}
.play-btn:active{ transform: translate(-50%,-50%) scale(0.92); }
.play-btn svg{ width:26px; height:26px; color:#fff; margin-left:3px; }

.reel-info{
  position:relative; z-index: 4;
  padding: 18px 84px 26px 18px;
  width:100%;
}
/* Tips page: caption above the media instead of over the bottom.
   padding-top clears the 84px feed-header so it doesn't overlap the logo. */
.reel-info-top{
  align-self: flex-start;
  padding: 96px 20px 16px 18px;
}
.reel-tag{
  display:inline-block;
  font-size: 11px; font-weight:800;
  letter-spacing: 0.6px;
  text-transform:uppercase;
  color: #241206;
  background: var(--orange);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.reel-info h3{
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 6px;
  color:#fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.reel-info p{
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin:0;
  line-height:1.45;
  max-width: 88%;
}
.reel-side{
  position:absolute; right:12px; bottom:26px;
  z-index:4;
  display:flex; flex-direction:column; align-items:center; gap:18px;
}
.reel-side button{
  background:none; border:none; color:#fff;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  font-size: 10.5px; font-weight:600;
  cursor:pointer;
}
.reel-side svg{ width:24px; height:24px; }

.progress-dots{
  position:absolute; top:10px; left:12px; right:12px;
  display:flex; gap:4px; z-index: 20;
}
.progress-dots span{
  flex:1; height:3px; border-radius:2px;
  background: rgba(255,255,255,0.3);
}
.progress-dots span.seen{ background: var(--orange); }

/* Real tip media (images fill the reel like video, but always visible) */
.reel-img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit: cover;
}
/* Text after the WhatBox logo in the feed header */
.feed-header .header-text{
  pointer-events:all;
  font-family: var(--font-display);
  font-size: 15px; font-weight:700;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-left: 10px;
}
.feed-header .header-spacer{ flex:1; }
/* "Swipe up" hint over the first tip; hidden once the user scrolls */
.swipe-hint{
  position:absolute; left:50%; bottom: calc(var(--nav-h) + 26px);
  transform: translateX(-50%);
  z-index: 25;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  color: rgba(255,255,255,0.9);
  font-size: 12px; font-weight:600;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events:none;
  transition: opacity .3s ease;
}
.swipe-hint.hide{ opacity:0; }
.swipe-hint svg{ width:22px; height:22px; animation: swipeup 1.4s ease-in-out infinite; }
@keyframes swipeup{
  0%,100%{ transform: translateY(3px); opacity:0.6; }
  50%{ transform: translateY(-3px); opacity:1; }
}
/* Empty/error state when no tips are available */
.tips-empty{
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; text-align:center; padding: 0 32px;
  color: var(--cream-dim);
}
.tips-empty strong{ color: var(--cream); font-family: var(--font-display); font-size:18px; }

/* ---------- hero ---------- */
.hero{
  position:relative;
  padding-top: 6px;
}
.hero-img-wrap{
  position:relative;
  margin: 0 16px;
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero-img-wrap img{ width:100%; height:auto; display:block; object-fit: contain; }
.hero-img-wrap::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(24,15,7,0) 78%, rgba(24,15,7,0.92) 100%);
}
.hero-caption{
  position:absolute; left:18px; right:18px; bottom:16px; z-index:2;
}
.hero-caption .chip{
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(20,13,7,0.55);
  border:1px solid rgba(255,255,255,0.25);
  color:#fff; font-size:11.5px; font-weight:700;
  padding: 5px 10px; border-radius:999px; margin-bottom:10px;
}
.hero-caption .chip .dot{ width:7px; height:7px; border-radius:50%; background:#3ddc73; }
.hero-caption h1{
  font-family: var(--font-display);
  font-size: 26px; line-height:1.15;
  color:#fff; margin:0;
  text-shadow: 0 2px 14px rgba(0,0,0,0.4);
}

.hero-cta{
  padding: 20px 20px 4px;
}

/* ---------- success page ---------- */
.success-badge{
  width: 84px; height:84px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--orange-2), var(--orange));
  display:flex; align-items:center; justify-content:center;
  margin: 8px auto 18px;
  box-shadow: 0 10px 26px rgba(238,123,43,0.4);
}
.success-badge svg{ width:40px; height:40px; color:#241206; }

.store-list{ display:flex; flex-direction:column; gap:12px; margin: 18px 0 28px; }

.divider-label{
  display:flex; align-items:center; gap:10px;
  margin: 26px 0 14px;
  color: var(--cream-dim);
  font-size: 12px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase;
}
.divider-label::before, .divider-label::after{
  content:""; flex:1; height:1px; background: var(--line);
}

/* ---- Form feedback (signup / OTP flow) ---- */
.form-alert{
  display:flex; align-items:flex-start; gap:10px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.4;
}
.form-alert.error{
  background: rgba(220,80,60,0.12);
  border: 1px solid rgba(220,80,60,0.45);
  color: #FFD9D0;
}
.form-alert.success{
  background: rgba(238,123,43,0.12);
  border: 1px solid rgba(238,123,43,0.4);
  color: var(--cream);
}
.otp-input{
  letter-spacing: 8px;
  font-size: 22px;
  text-align: center;
  font-family: var(--font-display);
}
.resend-row{
  display:flex; justify-content:space-between; align-items:center;
  margin-top: 4px;
}
.resend-row button{
  background:none; border:none; padding:0;
  color: var(--orange-2); font-size: 13px; font-weight:600;
  text-decoration: underline; cursor:pointer;
  font-family: var(--font-body);
}
.resend-row button:disabled{
  color: var(--cream-dim); cursor:default; text-decoration:none;
}
