/* =====================================================================
   Callibi — Design System v2
   A quiet, editorial take on "premium SaaS": one ink canvas, one accent,
   hairline structure instead of heavy glass, generous whitespace, and a
   single signature moment (the Callibi Number odometer). Restraint is
   the point — every effect that doesn't earn its place has been cut.
   ===================================================================== */

:root {
  /* ---- Surface & ink ------------------------------------------------ */
  --ink:            #0a0a0c;
  --ink-2:          #101013;
  --paper:          #f7f6f3;
  --paper-dim:      #cfcdc8;

  /* ---- Lines & surfaces ---------------------------------------------*/
  --line:           rgba(255, 255, 255, 0.07);
  --line-strong:    rgba(255, 255, 255, 0.15);
  --surface-1:      rgba(255, 255, 255, 0.025);
  --surface-2:      rgba(255, 255, 255, 0.045);
  --surface-3:      rgba(255, 255, 255, 0.07);

  /* ---- Text -----------------------------------------------------------*/
  --mute-1:         #a3a2a8;
  --mute-2:         #6f6e75;
  --mute-3:         #47474d;

  /* ---- Accent: a restrained cardinal red, never neon ------------------*/
  --red:            #c3172f;
  --red-hover:      #a51228;
  --red-wash:       rgba(195, 23, 47, 0.09);
  --red-wash-2:     rgba(195, 23, 47, 0.16);
  --red-line:       rgba(195, 23, 47, 0.38);

  /* ---- Type -----------------------------------------------------------*/
  --font-sans: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Shape & motion --------------------------------------------------*/
  --r-sm: 7px;
  --r-md: 13px;
  --r-lg: 20px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, .display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--paper);
  line-height: 1.15;
}

p { color: var(--mute-1); }

.mono, .callibi-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1.5px solid var(--red);
  outline-offset: 3px;
}

::selection { background: var(--red-wash-2); color: var(--paper); }

.container-xl { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.text-muted-2 { color: var(--mute-1) !important; }
.text-red { color: var(--red) !important; }

/* ---------------------------------------------------------------------
   Background — a single quiet grain, no colour blobs
   --------------------------------------------------------------------- */
.grain-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #0a0a0c 0%, #0c0c0f 60%, #0a0a0c 100%);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.02 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------------
   Navbar — minimal, hairline, no coloured chrome
   --------------------------------------------------------------------- */
.navbar-callibi {
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  transition: box-shadow 0.3s var(--ease-soft);
}

.brand-mark {
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.brand-mark .dot { color: var(--red); }

.nav-link-callibi {
  color: var(--mute-1);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px !important;
  transition: color 0.2s var(--ease-soft);
}
.nav-link-callibi:hover, .nav-link-callibi.active { color: var(--paper); }

/* ---------------------------------------------------------------------
   Buttons — flat, precise, restrained hover
   --------------------------------------------------------------------- */
.btn-callibi-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  border-radius: var(--r-sm);
  padding: 11px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.006em;
  transition: background 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}
.btn-callibi-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: #fff;
  transform: translateY(-1px);
}
.btn-callibi-primary:active { transform: translateY(0); }

.btn-callibi-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease-soft), background 0.2s var(--ease-soft);
}
.btn-callibi-ghost:hover {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--paper);
}

/* ---------------------------------------------------------------------
   Surfaces — hairline cards, not stacked blur
   --------------------------------------------------------------------- */
.glass-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}

.glass-panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero-section {
  padding: 156px 0 108px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-1);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 15px 7px 12px;
}
.hero-eyebrow .pulse {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
}

.hero-headline {
  font-size: clamp(2.5rem, 5vw, 4.1rem);
  line-height: 1.06;
  margin: 26px 0 22px;
  max-width: 620px;
}

.hero-sub {
  font-size: 1.13rem;
  line-height: 1.6;
  color: var(--mute-1);
  max-width: 500px;
}

/* Signature element: the Callibi Number odometer. Quiet, exact, once. */
.number-odometer {
  display: inline-flex;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 500;
  color: var(--paper-dim);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.number-odometer .digit {
  width: 1ch;
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  position: relative;
}
.number-odometer .digit span {
  display: block;
  opacity: 0;
  animation: tick 0.6s var(--ease) forwards;
}
@keyframes tick {
  0%   { transform: translateY(35%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.number-odometer .sep { color: var(--red); align-self: center; }

.hero-visual-card {
  border-radius: var(--r-lg);
  padding: 32px;
  position: relative;
}
.hero-visual-card .id-row {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px; margin-bottom: 20px;
}
.hero-visual-card .avatar-dot {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: var(--paper);
}
.hero-visual-card .action-row { display: flex; gap: 8px; margin-top: 22px; }
.hero-visual-card .action-pill {
  flex: 1;
  text-align: center;
  padding: 13px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--mute-1);
  transition: border-color 0.2s, color 0.2s;
}
.hero-visual-card .action-pill:hover { border-color: var(--red-line); color: var(--paper); }
.hero-visual-card .action-pill i { font-size: 0.95rem; }

/* ---------------------------------------------------------------------
   Section rhythm
   --------------------------------------------------------------------- */
.section-callibi { padding: 108px 0; border-top: 1px solid var(--line); }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
  display: block;
}
.section-title { font-size: clamp(1.9rem, 3vw, 2.5rem); margin-bottom: 18px; letter-spacing: -0.03em; }
.section-sub { color: var(--mute-1); max-width: 560px; font-size: 1.03rem; line-height: 1.65; }

/* Feature grid */
.feature-card {
  padding: 30px 28px;
  height: 100%;
}
.feature-card:hover { border-color: var(--line-strong); }
.feature-card .icon-tile {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  margin-bottom: 22px;
  font-size: 1rem;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: 9px; letter-spacing: -0.015em; }
.feature-card p { color: var(--mute-1); font-size: 0.92rem; margin: 0; line-height: 1.6; }

/* Steps — a genuine sequence, so numbering carries real information */
.step-row {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.step-row:last-child { border-bottom: none; }
.step-index {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--red);
  min-width: 34px;
  padding-top: 4px;
}
.step-body h4 { font-size: 1.04rem; margin-bottom: 7px; letter-spacing: -0.015em; }
.step-body p { color: var(--mute-1); margin: 0; font-size: 0.94rem; line-height: 1.6; }

/* Comparison rows */
.why-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.why-row:last-child { border-bottom: none; }
.why-row .check {
  color: var(--red);
  font-family: var(--font-mono);
  flex-shrink: 0;
  padding-top: 2px;
}
.why-row div { color: var(--mute-1); font-size: 0.96rem; line-height: 1.6; }
.why-row strong { color: var(--paper); font-weight: 600; }

/* Future-of-communication tag pills — quieter, text-forward */
.badge.glass-card {
  border-radius: 999px !important;
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
  letter-spacing: -0.01em;
}

/* CTA band */
.cta-band {
  padding: 34px 40px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta-band h3 { font-size: 1.3rem; letter-spacing: -0.02em; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.footer-callibi {
  border-top: 1px solid var(--line);
  padding: 68px 0 32px;
  color: var(--mute-1);
  font-size: 0.88rem;
}
.footer-callibi a { color: var(--mute-1); transition: color 0.2s; line-height: 2.1; }
.footer-callibi a:hover { color: var(--paper); }
.footer-heading {
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.social-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 8px;
  color: var(--mute-1);
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}
.social-icon:hover { border-color: var(--red-line); color: var(--paper); }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; padding: 72px 0; }
.auth-card { padding: 48px; max-width: 460px; margin: 0 auto; width: 100%; }
.form-label-callibi {
  font-size: 0.83rem;
  color: var(--mute-1);
  margin-bottom: 7px;
  display: block;
  font-weight: 500;
}
.form-control-callibi {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  color: var(--paper);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.form-control-callibi:focus {
  outline: none;
  border-color: var(--red);
  background: var(--surface-2);
}
.form-control-callibi::placeholder { color: var(--mute-3); }
.input-group-callibi { margin-bottom: 19px; }
.divider-or {
  display: flex; align-items: center; gap: 14px;
  color: var(--mute-2); font-size: 0.8rem;
  margin: 24px 0;
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.alert-callibi {
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-size: 0.89rem;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-callibi.success { background: var(--red-wash); border-color: var(--red-line); color: #f0b9c1; }
.alert-callibi.error   { background: var(--red-wash-2); border-color: var(--red); color: #f7c9cf; }

/* Legal pages */
.legal-body h2 { font-size: 1.28rem; margin-top: 44px; margin-bottom: 14px; letter-spacing: -0.02em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--mute-1); font-size: 0.97rem; line-height: 1.75; }
.legal-body ul { padding-left: 22px; }
.legal-toc {
  position: sticky; top: 108px;
  padding: 24px;
}
.legal-toc a { display: block; padding: 7px 0; font-size: 0.88rem; color: var(--mute-1); }
.legal-toc a:hover { color: var(--red); }

@media (max-width: 991px) {
  .legal-toc { position: static; margin-bottom: 36px; }
  .hero-section { padding: 108px 0 72px; text-align: center; }
  .hero-headline, .hero-sub { margin-left: auto; margin-right: auto; }
  .number-odometer { justify-content: center; width: 100%; }
}

@media (max-width: 575px) {
  .auth-card { padding: 32px 24px; }
  .cta-band { padding: 26px 24px; }
}

/* ---------------------------------------------------------------------
   Mobile input stability — iOS Safari auto-zooms on focus for any input
   with font-size under 16px, which looks exactly like "the screen jumped."
   Forcing 16px here (mobile only, so desktop keeps its normal sizing)
   stops that entirely, across every form on the site and the dialer.
   --------------------------------------------------------------------- */
@media (max-width: 767px) {
  input, textarea, select, .form-control-callibi {
    font-size: 16px !important;
  }
}

/* ---------------------------------------------------------------------
   iPhone "Add to Home Screen" install popup
   --------------------------------------------------------------------- */
.ios-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.ios-install-card {
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}
.ios-install-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--mute-1);
  font-size: 1.1rem;
  line-height: 1;
}
.ios-install-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--red-wash);
  border: 1px solid var(--red-line);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.ios-install-steps { display: flex; flex-direction: column; gap: 12px; }
.ios-install-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--mute-1);
  font-size: 0.94rem;
  line-height: 1.5;
}
.ios-install-step strong { color: var(--paper); }
.ios-install-step i { color: var(--red); margin: 0 2px; }
.ios-install-num {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: 0.82rem;
  flex-shrink: 0;
  border: 1px solid var(--red-line);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------------------------------------------------------------------
   Elevation on hover — the one place shadow is allowed to do real work
   --------------------------------------------------------------------- */
.glass-card:hover, .hero-visual-card:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 16px 40px -20px rgba(0,0,0,0.55);
}

/* Feature icon tiles — a soft tint reads richer than a bare outline */
.feature-card .icon-tile {
  background: var(--red-wash);
  border-color: var(--red-line);
}

/* ---------------------------------------------------------------------
   Scroll reveal — one quiet fade-up, applied via IntersectionObserver
   --------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease-soft), transform 0.6s var(--ease-soft); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------------
   Number picker (register.php)
   --------------------------------------------------------------------- */
.number-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.number-chip {
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--paper-dim);
  padding: 13px 10px;
  font-size: 0.92rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-soft), background 0.18s var(--ease-soft), color 0.18s var(--ease-soft);
}
.number-chip:hover { border-color: var(--red-line); color: var(--paper); }
.number-chip.selected {
  background: var(--red-wash);
  border-color: var(--red);
  color: var(--paper);
}
.chip-skeleton {
  height: 44px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-2) 50%, var(--surface-1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.btn-shuffle {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--mute-1);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: border-color 0.18s, color 0.18s;
}
.btn-shuffle:hover { border-color: var(--red-line); color: var(--paper); }

/* ---------------------------------------------------------------------
   Admin table
   --------------------------------------------------------------------- */
.table-dark {
  --bs-table-bg: transparent;
  --bs-table-color: var(--paper);
  background: transparent;
}
.table-dark td, .table-dark th { background: transparent; border-color: var(--line); }

/* ---------------------------------------------------------------------
   Mobile nav collapse — match the dark theme (Bootstrap default is white)
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-top: 14px;
    padding: 16px;
  }
  .navbar-nav { gap: 4px; }
}

/* Disabled submit affordance */
.btn-callibi-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------------------------------------------
   VIP number store
   --------------------------------------------------------------------- */
.vip-card { text-align: center; }
.vip-number {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 4px;
}
