/* CyberTips Mobile v2 - design tokens & shared components.
   A single token scale (spacing/radius/shadow/color) replaces the
   ad hoc one-off inline values from the v1 app so every screen reads
   as one consistent system instead of stitched-together cards. */

:root {
  /* Brand - dark theme. Four dark tiers for depth: --c-ink (deepest,
     "recessed well" accents like the appbar/reference-number card) <
     --c-bg-sunk (grooved tracks) < --c-bg (page) < --c-surface (cards,
     most elevated) - standard dark-UI convention where raised surfaces
     get lighter, not darker. */
  --c-ink: #0e0f0c;
  --c-bg-sunk: #121317;
  --c-bg: #18191d;
  --c-surface: #232429;

  --c-primary: #e8327a;
  --c-primary-dark: #ff5c9d;
  --c-primary-tint: rgba(232,50,122,0.18);
  --c-secondary: #29c076;
  --c-secondary-tint: rgba(41,192,118,0.16);
  --c-purple: #9161f3;
  --c-purple-tint: rgba(145,97,243,0.2);
  --c-warning: #e0952f;
  --c-warning-tint: rgba(224,149,47,0.18);
  --c-danger: #e2574a;
  --c-danger-tint: rgba(226,87,74,0.18);

  --c-border: rgba(255,255,255,0.09);
  --c-border-strong: rgba(255,255,255,0.17);
  --c-text: #f3f1f2;
  --c-text-muted: #a29ea4;
  --c-text-faint: #726d73;
  --c-on-dark: #ffffff;
  --c-on-dark-muted: rgba(255,255,255,0.62);
  --c-on-dark-faint: rgba(255,255,255,0.4);

  /* Spacing - 4pt rhythm */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* Radius */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;

  /* Shadow - black shadows are invisible on a dark surface, so elevation
     leans on a subtle light hairline plus a deeper black falloff. */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg: 0 16px 44px rgba(0,0,0,0.55);
  --shadow-primary: 0 8px 22px rgba(232,50,122,0.35);
  --shadow-secondary: 0 8px 22px rgba(41,192,118,0.3);

  /* Motion */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-fast: 150ms;
  --dur-base: 220ms;

  /* Icon stroke - one weight everywhere */
  --stroke: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .ct-display { font-family: 'Manrope', sans-serif; }

button { font: inherit; touch-action: manipulation; }
input, textarea, select { font: inherit; }
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--c-primary);
  outline-offset: 2px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(232,50,122,0.14);
}
input::placeholder, textarea::placeholder { color: var(--c-text-faint); }

.phone-scroll::-webkit-scrollbar { width: 0; }
.phone-scroll { scrollbar-width: none; }

select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a29ea4' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
}

.app-screen {
  width: 100%; max-width: 560px; margin: 0 auto;
  height: 100vh; height: 100dvh;
  background: var(--c-bg);
  overflow-y: auto; overflow-x: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- Shared component classes ---- */

/* Dark app-bar: one shared header used across every tab so the app has a
   single consistent chrome instead of a bespoke hero re-invented per screen. */
.ct-appbar {
  background: var(--c-ink);
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  position: sticky; top: 0; z-index: 30;
  min-height: 56px;
}
.ct-appbar-left { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.ct-appbar-icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.08); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.ct-appbar-icon-btn:hover { background: rgba(255,255,255,0.15); }
.ct-appbar-title { font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; }
.ct-appbar-eyebrow { font-size: 10px; font-weight: 700; color: var(--c-on-dark-faint); letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }

.ct-card {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.ct-card-dark {
  background: var(--c-ink);
  border-radius: var(--r-lg);
  color: #fff;
}

.ct-btn {
  border: none; cursor: pointer; font-family: 'Manrope', sans-serif; font-weight: 800;
  border-radius: var(--r-md);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  min-height: 44px;
}
.ct-btn:active { transform: scale(0.98); }
.ct-btn-primary { background: var(--c-primary); color: #fff; box-shadow: var(--shadow-primary); }
.ct-btn-secondary { background: var(--c-secondary); color: #fff; box-shadow: var(--shadow-secondary); }
.ct-btn-ghost { background: var(--c-surface); color: var(--c-text); border: 1.5px solid var(--c-border-strong); box-shadow: none; }
.ct-btn-disabled { background: #3a3b40 !important; color: rgba(255,255,255,0.5) !important; box-shadow: none !important; cursor: default !important; }

.ct-chip {
  border-radius: var(--r-pill); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 9px 14px; border: 1.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text-muted);
  transition: all var(--dur-fast) var(--ease-out); min-height: 38px;
}
.ct-chip.on { background: var(--c-secondary); border-color: var(--c-secondary); color: #fff; }

.ct-icon-circle {
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.pop { animation: ctPopIn var(--dur-base) var(--ease-out); }
@keyframes ctPopIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.slide-up { animation: ctSlideUp var(--dur-base) var(--ease-out); }
@keyframes ctSlideUp { 0% { transform: translateY(12px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes ctConfettiFall { 0% { transform: translateY(-40px) rotate(0deg); opacity: 1; } 100% { transform: translateY(720px) rotate(720deg); opacity: 0; } }

.ct-nav-bar {
  position: sticky; bottom: 0; z-index: 40;
  background: rgba(20,21,25,0.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-2) 0 calc(var(--sp-2) + env(safe-area-inset-bottom));
  display: flex;
}
.ct-nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; min-height: 44px;
}
.ct-nav-btn span { font-size: 10px; font-weight: 700; }
