/* =========================================================
   NexGenX Digital Card – style.css
   Mobile-first. Breakpoints: 360px, 600px, 900px, 1200px
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #f3f8fa;
  --card: #ffffff;
  --ink: #0b2a4a;
  --mut: #5b7186;
  --teal: #0aa5b5;
  --teal2: #00b4d0;
  --org: #e8622c;
  --line: #e1ecf0;
  --sh: 0 10px 30px rgba(11, 42, 74, .08);
  --maxw: 520px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07151f;
    --card: #0e2230;
    --ink: #eaf4f8;
    --mut: #92a9b8;
    --line: #1a3445;
    --sh: 0 10px 30px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #07151f;
  --card: #0e2230;
  --ink: #eaf4f8;
  --mut: #92a9b8;
  --line: #1a3445;
  --sh: 0 10px 30px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px calc(110px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Menu ---------- */
.menu {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: 0 -16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu::-webkit-scrollbar { display: none; }

.menu a {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.menu a:hover { border-color: var(--teal); }
.menu a.on {
  background: linear-gradient(135deg, var(--teal2), var(--teal));
  color: #fff;
  border-color: transparent;
}

section { scroll-margin-top: 72px; }

/* ---------- Hero ---------- */
.hero {
  margin: 0 -16px;
  background: linear-gradient(160deg, #00b4d0 0%, #0a8fa8 55%, #0b2a4a 130%);
  padding: 34px 20px 70px;
  text-align: center;
  color: #fff;
  border-radius: 0 0 36px 36px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero::before { width: 260px; height: 260px; right: -90px; top: -80px; }
.hero::after  { width: 200px; height: 200px; left: -80px; bottom: -90px; }

.logo {
  width: 132px;
  height: 132px;
  border-radius: 30px;
  object-fit: cover;
  background: #0b2a4a;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  border: 3px solid rgba(255, 255, 255, .55);
  position: relative;
  z-index: 1;
}

h1 {
  margin: 16px 0 4px;
  font-size: 26px;
  letter-spacing: -.3px;
  position: relative;
  z-index: 1;
}

.sub {
  margin: 0;
  font-size: 14.5px;
  opacity: .95;
  color: #fff;
  position: relative;
  z-index: 1;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.chips span {
  background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Quick actions ---------- */
.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: -38px 0 18px;
  position: relative;
  z-index: 2;
}

.act {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--sh);
  padding: 13px 4px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s;
}
.act:hover { transform: translateY(-2px); }
.act:active { transform: scale(.96); }
.act svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto 5px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.act.wa svg { stroke: #25d366; }

/* ---------- Content layout ---------- */
.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

section {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--sh);
  padding: 22px 20px;
  border: 1px solid var(--line);
  min-width: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  width: 5px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(var(--teal2), var(--org));
}

p { margin: 0 0 10px; color: var(--mut); font-size: 14.5px; }
.lead { color: var(--ink); }

/* ---------- Contact rows ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.row:first-of-type { border-top: 0; }
.row small { display: block; color: var(--mut); font-size: 12px; }
.row b { font-size: 15.5px; }

.ic {
  padding: 10px;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(10, 165, 181, .12);
  display: grid;
  place-items: center;
}
.ic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Services ---------- */
.svc { display: grid; gap: 12px; }

.s {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s, border-color .2s;
}
.s:hover { border-color: var(--teal); transform: translateY(-2px); }
.s .ic {
  background: linear-gradient(135deg, var(--teal2), var(--teal));
  flex-basis: 48px;
  height: 48px;
}
.s .ic svg { stroke: #fff; }
.s em { margin-left: auto; font-style: normal; font-size: 26px; color: var(--teal); }
.s b, .s h3 { margin: 0; display: block; font-size: 15.5px; font-weight: 700; }
.s span { font-size: 13px; color: var(--mut); }
.s .ic span { color: inherit; }

/* ---------- Form ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #25d366, #128c7e);
  text-decoration: none;
  cursor: pointer;
  margin-top: 12px;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.05); }

label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 5px; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zoom on focus */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; }
textarea { min-height: 88px; resize: vertical; }

/* ---------- Connect card ---------- */
.pay {
  background: linear-gradient(135deg, #0b2a4a, #0a6e82);
  color: #fff;
  border: 0;
}
.pay h2, .pay p { color: #fff; }
.pay p { opacity: .85; }

footer {
  text-align: center;
  color: var(--mut);
  font-size: 12.5px;
  padding: 18px 0 0;
}

/* ---------- Fixed call bar ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}
.bar {
  pointer-events: auto;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0b2a4a, #0a7d93);
  color: #fff;
  border-radius: 18px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  text-decoration: none;
}
.bar b { font-size: 18px; letter-spacing: .3px; display: block; line-height: 1.2; }
.bar small { opacity: .8; font-size: 11.5px; }
.bar i {
  margin-left: auto;
  background: #25d366;
  border-radius: 12px;
  padding: 10px 16px;
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
}

/* ---------- Share sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }
.sb { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }

.sp {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
  max-height: 90vh;
  overflow-y: auto;
}
.sp > b { display: block; font-size: 17px; margin-bottom: 14px; text-align: center; }

.sg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; }
.sg a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}
.sg a i {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 6px;
  border-radius: 16px;
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 18px;
}

.cp { display: flex; gap: 8px; margin-top: 16px; }
.cp input { flex: 1; min-width: 0; font-size: 13px; }
.cp button {
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal2), var(--teal));
  cursor: pointer;
}
.x {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- Toast (created by script.js) ---------- */
.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  max-width: 492px;
  margin: 0 auto;
  z-index: 50;
  background: #0b2a4a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.toast[hidden] { display: none; }
.toast a { color: #7fe3ef; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Very small phones */
@media (max-width: 360px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .menu, .hero { margin-left: -12px; margin-right: -12px; }
  .actions { gap: 6px; }
  .act { font-size: 11px; }
  h1 { font-size: 23px; }
  .logo { width: 112px; height: 112px; }
  .bar b { font-size: 16px; }
  .bar i { padding: 9px 12px; font-size: 13px; }
  section { padding: 18px 16px; }
}

/* Phones in landscape (short screens) */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding: 20px 20px 56px; }
  .logo { width: 84px; height: 84px; border-radius: 22px; }
  h1 { margin-top: 10px; }
  .sp { max-width: 560px; }
}

/* Large phones / small tablets */
@media (min-width: 600px) {
  :root { --maxw: 720px; }
  .wrap { padding-top: 0; }
  .menu { justify-content: center; }
  .hero { padding: 44px 28px 80px; }
  .logo { width: 150px; height: 150px; border-radius: 34px; }
  h1 { font-size: 32px; }
  .sub { font-size: 16px; }
  .chips span { font-size: 13.5px; padding: 6px 16px; }
  .actions { gap: 14px; margin-top: -42px; }
  .act { padding: 16px 6px 12px; font-size: 13px; }
  .act svg { width: 26px; height: 26px; }
  section { padding: 26px 26px; }
  h2 { font-size: 18px; }
  p { font-size: 15px; }
  .svc { grid-template-columns: 1fr 1fr; }
  .svc .s:last-child { grid-column: 1 / -1; }

  /* Share sheet becomes a centered dialog */
  .sheet { align-items: center; padding: 20px; }
  .sp { border-radius: 24px; max-width: 440px; }
}

/* Tablets landscape / small laptops */
@media (min-width: 900px) {
  :root { --maxw: 980px; }
  .wrap { padding-top: 22px; padding-left: 24px; padding-right: 24px; }
  .menu {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 8px 10px;
    top: 12px;
    max-width: max-content;
    margin-left: auto;
    margin-right: auto;
  }
  .hero { margin: 0; border-radius: 36px; padding: 52px 40px 90px; }
  .actions { max-width: 640px; margin: -44px auto 22px; }

  /* Two-column dashboard grid */
  .content { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  #services { grid-column: 1 / -1; }
  .svc { grid-template-columns: repeat(3, 1fr); }
  .svc .s:last-child { grid-column: auto; }
  .s { flex-direction: column; align-items: flex-start; text-align: left; padding: 20px; }
  .s em { display: none; }
  .row { padding: 14px 0; }
  .menu a { font-size: 13.5px; }

  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* Large desktops */
@media (min-width: 1200px) {
  :root { --maxw: 1080px; }
  h1 { font-size: 38px; }
  .logo { width: 164px; height: 164px; }
  section { padding: 30px 32px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
