/* =====================================================================
   בית פרוכטר — אפליקציה משפחתית
   Design language: bright · airy · modern · soft pastel gradients
   ===================================================================== */

:root {
  /* ---- Neutrals (cool, bright) ---- */
  --bg:        #F6F7FB;
  --ink:       #20232E;     /* near-black text */
  --ink-soft:  #5B6072;     /* secondary */
  --ink-faint: #9499A9;     /* tertiary */
  --surface:   #FFFFFF;
  --surface-2: #F2F4FA;
  --line:      #E8EBF3;
  --line-soft: #EFF1F7;

  /* ---- Brand gradient (modern, friendly) ---- */
  --brand-1: #6C8BFF;       /* periwinkle */
  --brand-2: #A66BFF;       /* violet */
  --brand-grad: linear-gradient(135deg, #6C8BFF 0%, #A66BFF 100%);
  --brand-soft: #EEF0FF;

  /* ---- Sunny accent (points / rewards) ---- */
  --sun:      #FFB23E;
  --sun-2:    #FF8A4B;
  --sun-grad: linear-gradient(135deg, #FFC861 0%, #FF8A4B 100%);
  --sun-soft: #FFF3E0;

  /* ---- Status ---- */
  --good:   #2BC48A;
  --good-soft: #E2F8EF;
  --warn:   #FFB02E;
  --warn-soft: #FFF3DC;
  --alert:  #FF5D6C;
  --alert-soft: #FFE6E9;

  /* ---- Type ---- */
  --ui:      "Rubik", system-ui, sans-serif;
  --display: "Fredoka", "Rubik", sans-serif;

  /* ---- Radius ---- */
  --r-sm: 14px;
  --r:    20px;
  --r-lg: 28px;
  --r-xl: 36px;

  /* ---- Shadow (soft, lifted) ---- */
  --sh-1: 0 1px 2px rgba(40,48,80,.04), 0 4px 14px rgba(40,48,80,.06);
  --sh-2: 0 4px 12px rgba(40,48,80,.07), 0 16px 36px rgba(40,48,80,.10);
  --sh-3: 0 10px 30px rgba(40,48,80,.14), 0 30px 70px rgba(40,48,80,.16);
  --sh-color: 0 8px 24px rgba(108,139,255,.30);
}

/* ---- Person palette (bright jewel/candy tones) ----
   each: --c-X (solid), gradients & tints built inline via color-mix */
:root {
  --c-teal:    #18B6A6;
  --c-plum:    #C861B0;
  --c-burgund: #EC5F7E;
  --c-ochre:   #F2A53B;
  --c-emerald: #28C07E;
  --c-peri:    #5C82F6;
  --c-terra:   #F47A4B;
  --c-slate:   #3FB4D6;
  --c-coral:   #FF8FA0;
  --c-lilac:   #A488F0;
  --c-sage:    #79C887;
  --c-rust:    #E8743B;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--ui);
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(820px 560px at 8% -8%,  #FCE3EF 0%, transparent 56%),
    radial-gradient(760px 560px at 102% -4%, #E1ECFF 0%, transparent 52%),
    radial-gradient(720px 680px at 50% 112%, #E2FBF1 0%, transparent 56%),
    #EEF1F8;
  min-height: 100vh;
}

/* ====== App shell: phone column, responsive ====== */
.stage {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}
.phone {
  position: relative; width: 100%; max-width: 444px;
  height: 100vh; height: 100dvh;
  background: var(--bg);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--sh-3);
}
/* #app must fill the phone and be a flex column so the inner .scroll
   gets a bounded height and can actually scroll (instead of overflowing). */
#app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  .stage { padding: 26px; }
  .phone {
    height: min(940px, calc(100vh - 52px));
    border-radius: 46px;
    border: 1px solid var(--line);
    outline: 11px solid #15171F;
  }
}

/* confetti / fx canvas overlay */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 90; }

/* scroll region */
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* ====== Typography ====== */
.display { font-family: var(--display); font-weight: 600; letter-spacing: .2px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-1); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.tnum  { font-variant-numeric: tabular-nums; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }

/* ====== Card ====== */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  border: 1px solid var(--line-soft);
}

/* ====== Buttons ====== */
.btn {
  font-family: var(--ui); font-weight: 600; font-size: 15px;
  border: none; border-radius: 999px; padding: 13px 22px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-brand { background: var(--brand-grad); color: #fff; box-shadow: var(--sh-color); }
.btn-dark  { background: var(--ink); color: #fff; }
.btn-sun   { background: var(--sun-grad); color: #fff; box-shadow: 0 8px 22px rgba(255,138,75,.32); }
.btn-soft  { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }

/* ====== Chip ====== */
.chip { display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); border: none; cursor: pointer; }
.chip-on { background: var(--ink); color: #fff; }

/* segmented control */
.seg { display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 999px;
  border: none; cursor: pointer; transition: all .18s ease;
  background: transparent; color: var(--ink-soft); }
.seg-on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }

/* ====== Inputs ====== */
.inp { width: 100%; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 15px; font-family: var(--ui); color: var(--ink);
  outline: none; direction: rtl; transition: border-color .15s; }
.inp:focus { border-color: var(--brand-1); }

/* ====== Avatar ====== */
.av { border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-family: var(--display); font-weight: 600; overflow: hidden;
  background-size: cover; background-position: center top; box-shadow: var(--sh-1); }
.av-ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--ring, var(--brand-1)); }

/* ====== Tick (check button) ====== */
.tick { border-radius: 50%; flex-shrink: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: all .2s cubic-bezier(.2,.9,.3,1.4);
  border: 2.5px solid var(--line); background: transparent; }
.tick svg { opacity: 0; transform: scale(.4); transition: all .2s; }
.tick-on { border-color: transparent; }
.tick-on svg { opacity: 1; transform: scale(1); }

/* ====== Animations ====== */
@keyframes riseIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform:none; } }
@keyframes popIn  { 0% { opacity:0; transform: scale(.86); } 100% { opacity:1; transform: scale(1); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { transform: translateY(100%);} to { transform: translateY(0);} }
@keyframes floatUp { 0%{opacity:0;transform:translateY(8px) scale(.8)} 20%{opacity:1} 100%{opacity:0;transform:translateY(-46px) scale(1.1)} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
@keyframes flameFlick { 0%,100%{transform:rotate(-3deg) scale(1)} 50%{transform:rotate(3deg) scale(1.06)} }
@keyframes ringGrow { from{transform:scale(.5);opacity:.7} to{transform:scale(2.4);opacity:0} }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
@keyframes bounceIn { 0%{transform:scale(.3);opacity:0} 50%{transform:scale(1.08)} 70%{transform:scale(.94)} 100%{transform:scale(1);opacity:1} }

/* staggered entrance — base state VISIBLE; motion only when allowed */
.enter { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .enter { animation: riseIn .5s cubic-bezier(.2,.7,.2,1) both; }
}

.pulse  { animation: pulse 1.8s ease-in-out infinite; }
.flame  { display:inline-block; animation: flameFlick 1.1s ease-in-out infinite; transform-origin: 50% 80%; }

/* points float bubble */
.float-pts { position: absolute; z-index: 95; font-family: var(--display); font-weight: 600;
  color: var(--sun-2); font-size: 17px; pointer-events: none; animation: floatUp 1s ease-out forwards;
  text-shadow: 0 2px 6px rgba(255,138,75,.3); }

/* tap ripple ring */
.ripple { position: absolute; border-radius: 50%; border: 2px solid var(--good);
  pointer-events: none; animation: ringGrow .6s ease-out forwards; z-index: 94; }

/* toast */
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 104px; z-index: 96;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 9px; box-shadow: var(--sh-3);
  white-space: nowrap; font-size: 14.5px; font-weight: 600; animation: bounceIn .45s both; }

/* celebration overlay */
.celebrate { position: absolute; inset: 0; z-index: 92; display: grid; place-items: center;
  background: rgba(20,22,30,.42); backdrop-filter: blur(3px); animation: fadeIn .25s both; }
.celebrate-card { background: #fff; border-radius: var(--r-xl); padding: 30px 28px; text-align: center;
  width: 80%; max-width: 320px; box-shadow: var(--sh-3); animation: bounceIn .5s both; }

/* sheet */
.sheet-wrap { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column;
  justify-content: flex-end; background: rgba(20,22,30,.42); backdrop-filter: blur(2px);
  animation: fadeIn .2s both; }
.sheet { background: var(--bg); border-radius: 30px 30px 0 0; padding: 10px 0 22px;
  box-shadow: var(--sh-3); max-height: 88%; display: flex; flex-direction: column;
  animation: slideUp .34s cubic-bezier(.2,.8,.2,1) both; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 4px; }

/* progress bar fill */
.bar { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 5px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* top icon buttons */
.topbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-soft);
  background: #fff; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.topbtn:active { transform: scale(.94); }

/* floating action button */
.fab { position: absolute; bottom: 96px; inset-inline-start: 20px; z-index: 40;
  width: 56px; height: 56px; padding: 0; border-radius: 20px; border: none; cursor: pointer;
  background: var(--brand-grad); color: #fff; box-shadow: var(--sh-color);
  display: grid; place-items: center; }
.fab:active { transform: scale(.92); }

/* bottom nav */
.bottomnav { display: flex; justify-content: space-around; align-items: center;
  padding: 9px 6px calc(9px + env(safe-area-inset-bottom)); flex-shrink: 0;
  background: rgba(255,255,255,.86); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft); }
