/* =========================================================================
   TelePay — Direct Carrier Billing site
   Mobile-first, responsive, accessible. Plain CSS, no framework.
   Visual language: near-black canvas, bold gold accents, white rounded
   cards, charcoal headings — echoing the brand deck.
   ========================================================================= */

/* ----------------------------- Design tokens ----------------------------- */
:root {
  /* Brand gold */
  --gold-500: #F5B800;   /* primary accent          */
  --gold-600: #E0A400;   /* hover / pressed         */
  --gold-300: #FFD24D;   /* highlights              */
  --gold-tint: #FFF4D1;  /* soft icon backgrounds   */

  /* Near-black canvas (hero / footer / bands) */
  --dark-900: #1A1D27;
  --dark-800: #232733;
  --dark-700: #2E323F;

  /* Text */
  --ink: #23272F;        /* charcoal headings       */
  --ink-soft: #5C636E;   /* muted body text         */
  --link: #9C6B00;       /* accessible gold link    */

  /* Surfaces */
  --bg: #FFFFFF;
  --bg-alt: #F7F8FA;
  --border: #E7E9EE;
  --card-bg: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(26, 29, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 29, 39, 0.10);
  --shadow-lg: 0 18px 50px rgba(26, 29, 39, 0.18);
  --shadow-gold: 0 10px 28px rgba(245, 184, 0, 0.32);

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1140px;
  --space: clamp(3rem, 7vw, 5.5rem);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ----------------------------- Base / reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden; /* guard against decorative gradients/notches overflowing on mobile */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img, svg { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.15; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Accessibility helpers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--dark-900); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }

/* ----------------------------- Buttons ----------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; cursor: pointer;
  padding: .85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  min-height: 48px; /* comfortable mobile tap target */
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold-500); color: var(--dark-900); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--gold-600); color: var(--dark-900); box-shadow: var(--shadow-gold); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--dark-900); color: #fff; border-color: var(--dark-900); }
.btn-block { width: 100%; }

/* Buttons rendered on dark backgrounds */
.on-dark .btn-secondary { color: #fff; border-color: rgba(255,255,255,0.55); }
.on-dark .btn-secondary:hover { background: #fff; color: var(--dark-900); border-color: #fff; }

/* ----------------------------- Header / nav ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(8px); /* iOS Safari < 18 requires the prefix */
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; flex: 0 0 auto; }
/* Pin explicit dimensions so the inline SVG can never collapse during layout/paint. */
.brand-mark svg { width: 32px; height: 32px; display: block; }
.brand-name { font-size: 1.18rem; letter-spacing: -0.01em; }

.primary-nav ul { list-style: none; display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; }
.primary-nav a {
  color: var(--ink); font-weight: 500; font-size: .95rem;
  padding: .5rem .7rem; border-radius: 8px; white-space: nowrap;
}
.primary-nav a:hover { color: var(--dark-900); background: var(--bg-alt); text-decoration: none; }
.primary-nav .nav-cta {
  background: var(--gold-500); color: var(--dark-900); font-weight: 700;
  padding: .55rem 1.15rem; margin-left: .45rem; border-radius: 999px;
  white-space: nowrap; /* keep the pill on one line so its rounded shape never breaks */
}
.primary-nav .nav-cta:hover { background: var(--gold-600); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 46px; height: 46px; background: transparent; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
}
.nav-toggle-bar { width: 22px; height: 2px; background: var(--dark-900); margin: 0 auto; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- Hero -------------------------------------- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(900px 480px at 88% -8%, rgba(245, 184, 0, 0.45), transparent 60%),
    radial-gradient(700px 420px at 8% 110%, rgba(245, 184, 0, 0.18), transparent 58%),
    linear-gradient(155deg, var(--dark-900) 0%, var(--dark-800) 100%);
  padding: clamp(3.2rem, 8vw, 6rem) 0;
  overflow: hidden;
}
/* Subtle diagonal "shard" texture echoing the deck's glass motif */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 26px);
  mask-image: radial-gradient(700px 480px at 85% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 480px at 85% 0%, #000 30%, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700;
  color: var(--gold-300); margin-bottom: .7rem;
}
.tagline { font-size: 1.3rem; font-weight: 800; color: var(--gold-500); margin: 0 0 1rem; }
.hero-desc { color: rgba(255,255,255,0.82); max-width: 56ch; font-size: 1.04rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.7rem; }

/* Hero mockup card */
.hero-visual { display: flex; justify-content: center; }
.mock-card {
  width: min(420px, 100%); background: #fff; border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.3rem;
}
.mock-row { display: flex; gap: .4rem; margin-bottom: 1rem; }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: #E2E8F0; }
.mock-line { height: 10px; border-radius: 6px; background: #EDF0F4; margin: .4rem 0; }
.mock-line-lg { height: 16px; width: 70%; background: #E2E6EC; }
.mock-line-sm { width: 45%; }
.mock-pay {
  display: flex; align-items: center; gap: .7rem; padding: .8rem;
  border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0;
}
.mock-pay-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--gold-tint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mock-pay-text { flex: 1; }
.mock-badge {
  font-size: .72rem; font-weight: 700; color: var(--dark-900);
  background: var(--gold-500); padding: .3rem .55rem; border-radius: 999px; white-space: nowrap;
}
.mock-flow { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin: 1.1rem 0 .8rem; }
.mock-node {
  flex: 1; text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .3rem;
}
.mock-node-accent { background: var(--gold-500); color: var(--dark-900); border-color: var(--gold-500); }
.mock-arrow { color: var(--gold-600); font-weight: 800; }
.mock-confirm { text-align: center; color: #1B8A5A; font-weight: 700; font-size: .9rem; }

/* ----------------------------- Sections ---------------------------------- */
.section { padding: var(--space) 0; }
.section-alt { background: var(--bg-alt); }
.section-title { margin-bottom: .6rem; }
/* Gold "tab" accent under section titles, echoing the deck's header bands */
.section-title::after {
  content: ""; display: block; width: 56px; height: 5px; border-radius: 999px;
  background: var(--gold-500); margin-top: .7rem;
}
.section-lead { color: var(--ink-soft); max-width: 70ch; font-size: 1.06rem; margin-bottom: 1.5rem; }

/* ----------------------------- Steps ------------------------------------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
.step {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
}
.step p { margin: .15rem 0 0; color: var(--ink); font-weight: 500; }
.step-num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold-500); color: var(--dark-900); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ----------------------------- Cards ------------------------------------- */
.cards {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
}
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; background: var(--gold-tint);
  margin-bottom: .9rem; color: var(--dark-900);
}
/* Inline SVG icons render identically on every OS/browser (no emoji-font dependency). */
.card-icon svg { width: 24px; height: 24px; display: block; }

/* ----------------------------- Two-column lists -------------------------- */
.two-col { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.check-list li {
  position: relative; padding-left: 2.1rem; color: var(--ink); font-weight: 500;
}
.check-list li::before {
  content: "\2192"; position: absolute; left: 0; top: .05rem;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-500); color: var(--dark-900);
  display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 800;
}

/* ----------------------------- Compliance disclaimer --------------------- */
.disclaimer {
  margin-top: 1.5rem; font-size: .9rem; color: var(--ink-soft);
  background: var(--gold-tint); border: 1px solid #F2DFA0; border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

/* ----------------------------- Assistant band ---------------------------- */
.assistant-band {
  display: grid; grid-template-columns: 1fr; gap: 1.2rem; align-items: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--dark-900), var(--dark-700));
  color: #fff; border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-md);
}
.assistant-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 220px at 100% 0%, rgba(245,184,0,0.35), transparent 65%);
}
.assistant-band > * { position: relative; z-index: 1; }
.assistant-band .section-title,
.assistant-band .section-lead { color: #fff; }
.assistant-band .section-title::after { background: var(--gold-500); }
.assistant-band .section-lead { opacity: .92; margin-bottom: 0; }

/* ----------------------------- Contact ----------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.contact-details { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: .6rem; color: var(--ink-soft); }
.contact-details strong { color: var(--ink); }

.contact-form {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-md);
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.25);
}
.field textarea { resize: vertical; }
.form-status { margin: .9rem 0 0; font-weight: 700; font-size: .95rem; min-height: 1.2em; }
.form-status.success { color: #1B8A5A; }
.form-status.error { color: #C53030; }

/* ----------------------------- Footer ------------------------------------ */
.site-footer { background: var(--dark-900); color: #C7CCD6; padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.footer-brand .brand-name { color: #fff; font-size: 1.25rem; font-weight: 800; }
.footer-brand p { margin: .4rem 0 0; color: var(--gold-300); font-size: .92rem; font-weight: 600; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-nav a { color: #C7CCD6; font-size: .95rem; }
.footer-nav a:hover { color: var(--gold-500); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 1.5rem; padding-top: 1.2rem; }
.footer-bottom p { margin: 0; font-size: .85rem; color: #8E96A5; }
.footer-bottom .build-info { margin-top: .35rem; font-size: .78rem; color: #6B7280; }
.footer-bottom .build-info span { font-variant-numeric: tabular-nums; }

/* ----------------------------- Chat widget ------------------------------- */
.chat-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 200; }
.chat-fab {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gold-500); box-shadow: var(--shadow-gold);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, background .18s ease;
}
.chat-fab:hover { transform: scale(1.06); background: var(--gold-600); }

.chat-window {
  position: absolute; right: 0; bottom: 74px;
  width: min(340px, calc(100vw - 2.5rem));
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
  max-height: min(70vh, 520px);
  max-height: min(70dvh, 520px); /* dvh avoids the mobile URL-bar height jump */
}
.chat-window[hidden] { display: none; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--dark-900); color: #fff; padding: .85rem 1rem;
}
.chat-title { font-weight: 700; font-size: .98rem; }
.chat-title::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-500); margin-right: .5rem; vertical-align: middle;
}
.chat-close { background: transparent; border: none; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg-alt); }
.chat-msg { max-width: 85%; padding: .6rem .8rem; border-radius: 14px; font-size: .92rem; line-height: 1.45; }
.chat-msg.bot { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; align-self: flex-start; color: var(--ink); }
.chat-msg.user { background: var(--gold-500); color: var(--dark-900); border-bottom-right-radius: 4px; align-self: flex-end; font-weight: 600; }
.chat-input { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--border); background: #fff; }
.chat-input input { flex: 1; font: inherit; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; }
.chat-input input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.25); }
.chat-input button {
  font: inherit; font-weight: 700; cursor: pointer; padding: .65rem 1.1rem;
  background: var(--gold-500); color: var(--dark-900); border: none; border-radius: 10px;
}
.chat-input button:hover { background: var(--gold-600); }

/* ----------------------------- Responsive -------------------------------- */
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr; align-items: center; }
}

@media (min-width: 768px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .check-list { grid-template-columns: 1fr 1fr; }
  .assistant-band { grid-template-columns: 1fr auto; padding: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 920px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards-compact { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(5, 1fr); }
}

/* Mobile navigation: collapse links behind the toggle button.
   Breakpoint sits above the desktop layout grid (920px) so the 8-item nav never
   crowds/wraps in the awkward in-between band. */
@media (max-width: 1140px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .primary-nav.open { max-height: 80vh; overflow-y: auto; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1rem; }
  .primary-nav li { width: 100%; }
  .primary-nav a { display: block; padding: .85rem .4rem; border-radius: 8px; min-height: 48px; }
  .primary-nav .nav-cta { margin: .5rem 0 0; text-align: center; }
}
