/* ============================================================================
   WeinBus, Component kit (shared by landing + all three apps)
   Brand-aware (uses --brand-*) and RTL-safe (logical properties).
   ========================================================================== */

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-md);
  line-height: 1; padding: .85em 1.4em; border-radius: var(--r-pill); white-space: nowrap;
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t-med), filter var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--primary { background: var(--brand-gradient); color: var(--brand-on-primary); box-shadow: var(--sh-pop); }
.btn--primary:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 18px 38px rgba(245,166,35,.42); }
.btn--blue  { background: linear-gradient(135deg, var(--wb-blue), var(--wb-blue-deep)); color: #fff; box-shadow: 0 12px 26px rgba(30,136,229,.3); }
.btn--blue:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn--green { background: linear-gradient(135deg, var(--wb-green), var(--wb-green-deep)); color: #fff; box-shadow: 0 12px 26px rgba(16,185,129,.32); }
.btn--danger{ background: linear-gradient(135deg, #FF8585, var(--wb-coral-deep)); color: #fff; box-shadow: 0 12px 26px rgba(239,68,68,.3); }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--brand-primary); transform: translateY(-2px); }
.btn--soft  { background: var(--brand-primary-soft); color: var(--brand-primary-deep); }
.btn--soft:hover { filter: brightness(.98); }
.btn--dark  { background: var(--ink); color: #fff; }
.btn--lg { font-size: var(--fs-lg); padding: 1em 1.8em; }
.btn--sm { font-size: var(--fs-sm); padding: .6em 1.05em; }
.btn--block { width: 100%; }
.btn--icon { padding: .7em; border-radius: var(--r-md); aspect-ratio: 1; }
.btn--pill-icon { width: 44px; height: 44px; border-radius: 50%; padding: 0; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }

/* ---- Cards ------------------------------------------------------------ */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); }
.card--pad   { padding: var(--s5); }
.card--pad-lg{ padding: var(--s6); }
.card--hover { transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med); }
.card--hover:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); }
.card--glass { background: rgba(255,255,255,.72); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.6); }

/* ---- Chips, badges, status pills ------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .45em; padding: .42em .85em;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip--brand { background: var(--brand-primary-soft); color: var(--brand-primary-deep); border-color: transparent; }
.badge {
  display: inline-flex; align-items: center; gap: .4em; padding: .34em .7em;
  border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: var(--fw-x); line-height: 1;
}
.badge--ok    { background: var(--wb-green-soft); color: var(--wb-green-deep); }
.badge--info  { background: var(--wb-blue-soft);  color: var(--wb-blue-deep); }
.badge--warn  { background: var(--wb-amber-soft); color: #C2410C; }
.badge--danger{ background: var(--wb-coral-soft); color: var(--wb-coral-deep); }
.badge--muted { background: var(--line-soft); color: var(--ink-3); }
.badge--brand { background: var(--brand-primary-soft); color: var(--brand-primary-deep); }
.badge--purple{ background: var(--wb-purple-soft); color: #6D5BD0; }

/* ---- Live indicator --------------------------------------------------- */
.live { display: inline-flex; align-items: center; gap: .45em; font-weight: var(--fw-x);
  font-size: var(--fs-2xs); color: var(--wb-green-deep); text-transform: uppercase; letter-spacing: .07em; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wb-green); position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--wb-green); animation: pulse 1.8s infinite; }

/* ---- Avatars ---------------------------------------------------------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: var(--fw-x); color: #fff; flex: none;
  box-shadow: var(--sh-xs); overflow: hidden; line-height: 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 34px; height: 34px; font-size: var(--fs-xs); }
.avatar--lg { width: 60px; height: 60px; font-size: var(--fs-lg); }
.avatar--xl { width: 84px; height: 84px; font-size: var(--fs-2xl); }
.avatar-ring { padding: 3px; border-radius: 50%; background: var(--brand-gradient); display: inline-grid; }

/* ---- List rows -------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  border-radius: var(--r-md); transition: background var(--t-fast); }
.list--divided .row-item + .row-item { border-top: 1px solid var(--line-soft); border-radius: 0; }
.row-item--btn { cursor: pointer; }
.row-item--btn:hover { background: var(--surface-2); }

/* ---- Segmented control / tabs ---------------------------------------- */
.seg { display: inline-flex; background: var(--line-soft); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg button { padding: .5em 1.05em; border-radius: var(--r-pill); font-family: var(--font-display);
  font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--ink-2); transition: all var(--t-fast); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }
.seg--sm button { padding: .35em .8em; font-size: var(--fs-xs); }

/* ---- Toggle switch ---------------------------------------------------- */
.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative;
  transition: background var(--t-fast); flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: inset-inline-start var(--t-fast) var(--ease-bounce); }
.switch.on { background: var(--wb-green); }
.switch.on::after { inset-inline-start: 23px; }

/* ---- Stat tile -------------------------------------------------------- */
.stat { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.stat__num { font-family: var(--font-display); font-weight: var(--fw-x); font-size: var(--fs-2xl); line-height: 1; }
.stat__label { color: var(--ink-3); font-size: var(--fs-sm); font-weight: var(--fw-med); margin-top: 6px; }
.stat__icon { position: absolute; inset-inline-end: 14px; inset-block-start: 14px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }

/* ---- Progress --------------------------------------------------------- */
.progress { height: 10px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 99px; background: var(--brand-gradient); transition: width .6s var(--ease-out); width: 0; }
.progress--thin { height: 6px; }

/* ---- Toasts ----------------------------------------------------------- */
.toast-wrap { position: fixed; inset-block-start: 18px; inset-inline: 0; display: flex; flex-direction: column;
  align-items: center; gap: 10px; z-index: var(--z-toast); pointer-events: none; padding-inline: 14px; }
.toast { pointer-events: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  border: 1px solid var(--line); padding: 13px 16px; display: flex; align-items: center; gap: 12px;
  max-width: 430px; width: 100%; animation: fadeUp .4s var(--ease-out); }
.toast.leaving { opacity: 0; transform: translateY(-12px); transition: .3s var(--ease); }
.toast__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; flex: none; }
.toast__title { font-weight: var(--fw-x); font-family: var(--font-display); font-size: var(--fs-sm); }
.toast__msg { font-size: var(--fs-xs); color: var(--ink-2); }

/* ---- Overlay / modal / sheet ----------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(18,26,44,.46); backdrop-filter: blur(3px);
  z-index: var(--z-modal); display: grid; place-items: center; padding: 18px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-xl); width: min(560px, 100%);
  max-height: 90vh; overflow: auto; animation: popIn .32s var(--ease-bounce); }
.modal__head { padding: var(--s5) var(--s6); border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal__body { padding: var(--s6); }
.modal__close { width: 38px; height: 38px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font-size: 20px; color: var(--ink-2); }

/* ---- Inputs ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--ink-2); }
.input, .select { width: 100%; padding: .8em 1em; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface-2); transition: border-color var(--t-fast), box-shadow var(--t-fast); font-weight: 600; }
.input:focus, .select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 4px var(--brand-primary-soft); }

/* ===========================================================================
   DEVICE FRAMES
   ========================================================================= */
/* Phone */
.phone { width: var(--phone-w); height: var(--phone-h); background: #0c1426; border-radius: 48px;
  padding: 13px; box-shadow: var(--sh-xl), inset 0 0 0 2px rgba(255,255,255,.07); position: relative; flex: none; }
.phone__screen { width: 100%; height: 100%; background: var(--bg); border-radius: 37px; overflow: hidden; position: relative; }
.phone__notch { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translateX(-50%);
  width: 132px; height: 26px; background: #0c1426; border-radius: 0 0 16px 16px; z-index: 20; }
html[dir="rtl"] .phone__notch { transform: translateX(50%); }
.phone__screen iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Browser window (admin / desktop) */
.browser { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-xl); overflow: hidden; border: 1px solid var(--line); }
.browser__bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #EEF1F7; border-bottom: 1px solid var(--line); }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.browser__url { flex: 1; background: #fff; border-radius: 99px; padding: 6px 14px; font-size: var(--fs-xs); color: var(--ink-3); text-align: center; }
.browser__body iframe { width: 100%; border: 0; display: block; }

/* ===========================================================================
   APP SHELL (mobile apps: chaperone + parent, inside .phone__screen)
   ========================================================================= */
.app { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.statusbar { height: 30px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px 0 26px; font-size: 13px; font-weight: var(--fw-x); color: var(--ink); z-index: 15; }
.statusbar svg { display: inline-block; }
.appbar { flex: none; padding: 8px 18px 12px; display: flex; align-items: center; gap: 12px; z-index: 14; }
.appbar__title { font-family: var(--font-display); font-weight: var(--fw-x); font-size: var(--fs-lg); }
.appbody { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 90px; -webkit-overflow-scrolling: touch; }
.appbody::-webkit-scrollbar { width: 0; }
.tabbar { position: absolute; inset-block-end: 0; inset-inline: 0; height: 76px; background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(32,48,74,.06); display: flex; padding-bottom: 6px; z-index: 16; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: var(--fw-bold); color: var(--ink-3); transition: color var(--t-fast); position: relative; }
.tabbar a svg { width: 24px; height: 24px; transition: transform var(--t-fast) var(--ease-bounce); }
.tabbar a.active { color: var(--brand-primary-deep); }
.tabbar a.active svg { transform: translateY(-2px) scale(1.08); }
.tabbar a.active::before { content: ""; position: absolute; inset-block-start: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-primary-deep); }

/* App view switching */
.view { display: none; animation: fadeIn .35s var(--ease-out); }
.view.active { display: block; }

/* Section heading inside apps */
.sec-title { font-family: var(--font-display); font-weight: var(--fw-x); font-size: var(--fs-md);
  margin: var(--s5) 2px var(--s2); display: flex; align-items: center; justify-content: space-between; }

/* Floating confetti container */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.confetti i { position: absolute; inset-block-start: -14px; width: 9px; height: 14px; border-radius: 2px; animation: confettiFall linear forwards; }

/* Generic divider */
.hr { height: 1px; background: var(--line-soft); border: 0; margin: var(--s4) 0; }

/* ---- Floating "back to site" pill (shown in standalone apps) ---------- */
.wb-back { position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 200;
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px 9px 11px;
  background: var(--surface); color: var(--ink); border-radius: var(--r-pill);
  box-shadow: var(--sh-lg); border: 1px solid var(--line); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
  transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t-med); }
.wb-back:hover { transform: translateY(-1px); box-shadow: var(--sh-xl); }
.wb-back__ic { display: inline-flex; color: var(--brand-primary-deep); }
@media (min-width: 600px) { .wb-back { inset-block-start: 18px; inset-inline-start: 18px; } }
