/* BUMENU — Onboarding (3 pages) */
*{ box-sizing:border-box; }
html, body { height:100%; }
:root{
  --bumenu: #EE6074;
  --text: #111;
  --muted: rgba(0,0,0,.68);
  --border: rgba(0,0,0,.10);
  --shadow: 0 18px 55px rgba(0,0,0,.12);
  --radius: 22px;
}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:#fff;
  color: var(--text);
  overflow:hidden; /* no scroll in onboarding */
}

.screen{
  height: 100dvh;
  width: 100%;
  display:flex;
  flex-direction:column;
}

/* Fullscreen card */
.card{
  height:100%;
  width:100%;
  display:flex;
  flex-direction:column;
  background:#fff;
}

/* Header */
.header{
  flex: 0 0 auto;
  padding: 18px 18px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.logo{
  width: 150px;
  height:auto;
  display:block;
}

.skip{
  border:0;
  background:transparent;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 13px;
  cursor:pointer;
  opacity: .65;
  border-radius: 10px;
}
.skip:hover{ opacity: 1; background: rgba(0,0,0,.04); }

/* Hero (takes remaining space between header and footer) */
.hero{
  flex: 1 1 auto;
  min-height: 0; /* critical: allow shrinking */
  padding: 10px 18px 0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.illustration{
  width: min(520px, 92vw);
  height: 100%;
  max-height: 48vh; /* prevent huge image */
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 30%, rgba(238,96,116,.16), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.06), transparent 55%),
    linear-gradient(180deg, #fff, #fafafa);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  overflow:hidden;
  position:relative;
}

.illustration img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: contain;  /* never crop; never exceed */
  object-position:center;
  display:block;
}

/* Content */
.content{
  flex: 0 0 auto;
  padding: 16px 22px 14px;
  text-align:left;
}

.kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  font-weight: 800;
  font-size: 12.5px;
  color: rgba(0,0,0,.64);
}

.title{
  margin: 10px 0 6px;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.subtitle{
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Footer */
.footer{
  flex: 0 0 auto;
  padding: 14px 18px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.dots{ display:flex; gap:8px; align-items:center; }
.dot{
  width:8px; height:8px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  transition: width 140ms ease, transform 140ms ease, background-color 140ms ease;
}
.dot.is-active{
  width: 18px;
  background: var(--bumenu);
  transform: scale(1.05);
}

.actions{ display:flex; align-items:center; gap:10px; }

.btn{
  border:0;
  cursor:pointer;
  font-weight: 900;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, background-color 120ms ease;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }

.btn-ghost{
  background: rgba(0,0,0,.05);
  color: #111;
}
.btn-ghost:hover{ background: rgba(0,0,0,.08); }

.btn-primary{
  background: var(--bumenu);
  color:#fff;
  box-shadow: 0 12px 30px rgba(238, 96, 116, 0.35);
}
.btn-primary:hover{
  filter: brightness(1.05);
  box-shadow: 0 16px 38px rgba(238, 96, 116, 0.45);
}

/* Responsive tweaks */
@media (max-width: 380px){
  .logo{ width: 130px; }
  .title{ font-size: 22px; }
  .content{ padding: 14px 18px 12px; }
  .illustration{ max-height: 44vh; }
}

/* --- Footer visibility fix (PWA/standalone) v4 --- */
/* Problem: In installed PWAs, viewport units can be inconsistent and the footer may be clipped.
   Fix: Use internal scrolling + in standalone mode pin the footer to the viewport so it never disappears.
   This does NOT change navigation/JS. */

:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --footer-h: 72px; /* safe default; real footer content fits */
}

body{ overflow: hidden; }

/* Use svh/dvh when available */
.screen{
  height: 100vh;
  height: 100svh;
  height: 100dvh;
}

.card{
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

/* Safe areas */
.header{ padding-top: calc(18px + var(--safe-top)); }

/* Keep hero and content from pushing footer out */
.hero{
  flex: 0 0 auto;
  min-height: 0;
}

/* Image frame height controlled */
.illustration{
  height: clamp(180px, 34svh, 320px);
  max-height: 48svh;
}

/* Content uses remaining space and can scroll */
.content{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(14px + var(--safe-bottom));
}

/* Ensure image stays correct */
.illustration img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Standalone: pin footer to bottom of viewport to avoid clipping */
@media (display-mode: standalone){
  .footer{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #fff;
    padding-bottom: calc(18px + var(--safe-bottom));
  }

  /* Make sure content can scroll behind but not be hidden by fixed footer */
  .content{
    padding-bottom: calc(var(--footer-h) + var(--safe-bottom));
  }

  /* Slightly reduce illustration in standalone to help short screens */
  .illustration{
    height: clamp(170px, 30svh, 300px);
    max-height: 44svh;
  }
}

/* Very short screens: guarantee footer space */
@media (max-height: 640px){
  :root{ --footer-h: 84px; }
  .illustration{ height: clamp(160px, 28svh, 260px); max-height: 40svh; }
}
