/* Bobclass Go — design tokens */
:root {
  /* brand */
  --primary: #1F53AB;          /* Bobclass blue */
  --primary-press: #173F82;
  --primary-soft: #E8EEFA;     /* tinted bg for selected chips */
  --accent: #F26C4F;           /* orange (cancel, expiry, active nav) */
  --accent-warm: #E3783B;
  --success: #1F8A5B;
  --warn: #C77700;

  /* surfaces */
  --bg: #FFFFFF;
  --bg-app: #F7F5F0;            /* warm canvas behind the phone */
  --bg-card: #FFFFFF;
  --lavender: #F7F2FA;          /* chip/section card */
  --cream: #F6F4EB;             /* booking card section */

  /* text */
  --text: #1D1B20;
  --text-muted: #49454F;
  --text-soft: #79747E;

  /* borders */
  --border: #CAC4D0;
  --border-soft: #E6E0E9;
  --hairline: rgba(0,0,0,0.08);

  /* radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.18);

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input { font: inherit; }

/* App stage — center the phone screen */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 30% 0%, #EFEAE0 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, #ECE6F5 0%, transparent 55%),
    #F7F5F0;
}

/* Wrapper takes the SCALED size so the page doesn't leave a phantom box. */
.phone-wrap {
  --scale: min(1, calc((100vh - 48px) / 844), calc((100vw - 48px) / 390));
  width: calc(390px * var(--scale));
  height: calc(844px * var(--scale));
  flex-shrink: 0;
}

.phone {
  width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 36px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transform: scale(var(--scale, 1));
  transform-origin: top left;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  isolation: isolate;
}

/* Stack base for absolutely-positioned transitioning screens */
.screen-stack { position: relative; width: 100%; height: 100%; overflow: hidden; }

.screen-enter { animation: screenIn .32s var(--ease-out); }
.screen-exit  { animation: screenOut .24s var(--ease) both; pointer-events: none; }
@keyframes screenIn  { from { transform: translateX(20px); } }
@keyframes screenOut { from { transform: none; opacity: 1; } to { transform: translateX(-12px); opacity: 0; } }

/* status bar / scrollable region */
.scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.scroll::-webkit-scrollbar { width: 0; height: 0; }

.hairline { height: 1px; background: var(--border); }

/* typography helpers */
.h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.15; }
.h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.1px; line-height: 1.25; }
.h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.body { font-size: 14px; line-height: 1.45; color: var(--text-muted); }
.meta { font-size: 12px; line-height: 1.35; color: var(--text-soft); }

/* generic icon button */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease);
}
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.icon-btn:active { background: rgba(0,0,0,0.09); }

/* pill chip */
.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.chip:hover { background: #FAFAFA; }
.chip.is-active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* primary button */
.btn {
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 2px 6px rgba(31,83,171,0.25);
  white-space: nowrap;
}
.btn:hover { background: var(--primary-press); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(31,83,171,0.25); }
.btn.is-full { width: 100%; }
.btn.is-ghost { background: transparent; color: var(--primary); box-shadow: none; }
.btn.is-ghost:hover { background: var(--primary-soft); }
.btn.is-danger { background: var(--accent); box-shadow: 0 2px 6px rgba(242,108,79,0.3); }
.btn.is-danger:hover { background: #E55A3D; }
.btn.is-quiet { background: var(--lavender); color: var(--text); box-shadow: none; }
.btn.is-quiet:hover { background: #EFE7F4; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.is-sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* small label tag */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--lavender);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}
.tag.is-warn { background: #FFF1E2; color: #A14A12; }
.tag.is-success { background: #E2F4EB; color: #14613E; }
.tag.is-info { background: var(--primary-soft); color: var(--primary); }

/* skeleton/shimmer for the cancellable look */
.shimmer { position: relative; overflow: hidden; background: var(--lavender); }
.shimmer::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.7) 50%, transparent 70%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* sheet backdrop & sheet */
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 20, 28, 0.45);
  backdrop-filter: blur(2px);
  z-index: 50;
  animation: fadeIn .25s var(--ease);
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  z-index: 51;
  animation: sheetUp .35s var(--ease-out);
  max-height: 85%;
  display: flex; flex-direction: column;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
}
.sheet-grabber {
  width: 36px; height: 4px; border-radius: 99px; background: #DAD4DF;
  margin: 8px auto 4px;
}
.sheet-header { padding: 8px 20px 4px; text-align: center; font-weight: 600; font-size: 16px; }
.sheet-body { padding: 8px 20px 24px; overflow-y: auto; }
.sheet-footer { padding: 12px 16px calc(20px + env(safe-area-inset-bottom,0)); border-top: 1px solid var(--border-soft); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* generic card */
.card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}
.card.is-lavender { background: var(--lavender); border-color: transparent; }
.card.is-cream { background: var(--cream); border-color: transparent; }

/* segmented switch (Group/Private) */
.segmented {
  display: inline-flex;
  background: var(--lavender);
  border-radius: var(--r-pill);
  padding: 4px;
  width: 100%;
  position: relative;
}
.segmented button {
  flex: 1;
  height: 36px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: color .2s var(--ease);
}
.segmented button.is-active { color: #fff; }
.segmented .seg-pill {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  background: var(--text);
  border-radius: var(--r-pill);
  transition: transform .32s var(--ease-out);
  z-index: 0;
}

/* avatar */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}

/* focus ring */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
