/* ===========================================================================
   SFamily — marketing site
   ---------------------------------------------------------------------------
   Layout: a single dark column on the app's own top-to-bottom wash, with
   content held in glass panels. One bold moment only — the shield gradient in
   the hero — and everything else kept quiet around it.

   Every colour below is lifted verbatim from the app's single source of truth,
   lib/core/theme/app_colors.dart. If a value changes there, change it here;
   a landing page that is nearly the brand colour is worse than one that is
   obviously a different colour.

   Deliberately single-theme. The app has no light mode, and a light version of
   this page would be a different product.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* --- canvas ------------------------------------------------------------ */
  --canvas:        #001528;   /* AppColors.canvas       */
  --canvas-top:    #012E57;   /* AppColors.canvasTop    */
  --canvas-mid:    #011629;   /* appBackground 40% stop */
  --surface:       #011D2F;   /* AppColors.canvasRaised */
  --bar:           #01203A;   /* AppColors.barSurface   */

  /* --- accents ----------------------------------------------------------- */
  --mint:          #2BE07F;   /* AppColors.mint      — safe / primary  */
  --aqua:          #29D3E8;   /* AppColors.aqua      — info / links    */
  --alert:         #FF4D6D;   /* AppColors.alertRed  — SOS            */
  --gold:          #E1BC4B;   /* AppColors.warmGold  — pending        */

  /* --- text -------------------------------------------------------------- */
  --text:          #EAF2FF;   /* AppColors.textPrimary */
  --muted:         #8A97B1;   /* AppColors.textMuted   */

  /* --- glass ------------------------------------------------------------- */
  --glass-fill:    rgba(255, 255, 255, 0.06);
  --glass-border:  rgba(255, 255, 255, 0.10);
  --glass-strong:  rgba(255, 255, 255, 0.16);

  /* --- gradients --------------------------------------------------------- */
  --safe-gradient: linear-gradient(90deg, var(--aqua), var(--mint));
  --shield-gradient: linear-gradient(
    45deg, #02AAF1 0%, #11CCD1 35%, #63D87A 68%, #BCE72B 100%
  );

  /* --- type -------------------------------------------------------------- */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* --- scale ------------------------------------------------------------- */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --shell: 1140px;
}

/* ===========================================================================
   base
   ========================================================================= */

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

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);

  /* The app's own wash: a brighter navy at the top falling to near-black by
     roughly 40% down, then flat. Fixed so it does not band on a long scroll. */
  background:
    linear-gradient(
      180deg,
      var(--canvas-top) 0%,
      var(--canvas-mid) 40%,
      var(--canvas) 100%
    )
    var(--canvas) no-repeat;
  background-attachment: fixed;

  overflow-x: hidden;
}

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

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

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ===========================================================================
   layout shell
   ---------------------------------------------------------------------------
   One gutter rule, set here and nowhere else. padding-block keeps the sides
   from being zeroed by a shorthand further down the cascade.
   ========================================================================= */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.shell-narrow { max-width: 780px; }

.band { padding-block: clamp(64px, 9vw, 112px); }

.band-alt {
  background: linear-gradient(
    180deg, transparent, rgba(1, 29, 47, 0.55) 18%, rgba(1, 29, 47, 0.55) 82%, transparent
  );
}

/* ===========================================================================
   brand lockup
   ---------------------------------------------------------------------------
   Mirrors BrandLockup in the app: the mark, the wordmark painted through with
   the safe gradient, the tagline underneath.
   ========================================================================= */

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.lockup:hover { text-decoration: none; }

.lockup-mark { width: 44px; height: 44px; flex: none; }

.lockup-text { display: flex; flex-direction: column; line-height: 1.05; }

.wordmark {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: var(--safe-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wordmark-sm { font-size: 21px; }

.tagline {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  opacity: 0.85;
}

/* ===========================================================================
   header
   ========================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(1, 21, 40, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color 0.18s ease, background 0.18s ease;
}
.nav a:hover {
  color: var(--text);
  background: var(--glass-fill);
  text-decoration: none;
}

.nav .nav-cta {
  color: var(--canvas);
  background: var(--safe-gradient);
  font-weight: 700;
  margin-left: 6px;
}
.nav .nav-cta:hover { color: var(--canvas); filter: brightness(1.08); }

/* ===========================================================================
   typography
   ========================================================================= */

h1, h2, h3, h4 {
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.6px;
  line-height: 1.14;
}

h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 800; }
h2 { font-size: clamp(27px, 3.4vw, 40px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
h4 { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; }

p { margin: 0; }

.grad {
  background: var(--safe-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--mint);
}

.lede {
  font-size: clamp(16px, 1.6vw, 18.5px);
  line-height: 1.62;
  color: var(--text);
  opacity: 0.92;
  max-width: 56ch;
}

.sub {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 52ch;
}

.band-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 62ch;
  margin-bottom: clamp(34px, 4.4vw, 56px);
}

.band-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 60ch;
}

/* ===========================================================================
   buttons
   ========================================================================= */

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--safe-gradient);
  color: var(--canvas);
}
.btn-primary:hover { filter: brightness(1.08); color: var(--canvas); }

.btn-ghost {
  background: var(--glass-fill);
  border: 1px solid var(--glass-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

/* ===========================================================================
   1. hero
   ========================================================================= */

.hero { padding-block: clamp(48px, 7vw, 92px) clamp(56px, 8vw, 104px); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(43, 224, 127, 0.16);
  flex: none;
}

/* --- hero artwork -------------------------------------------------------- */

.hero-art {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.phone {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 300 / 600;
  max-width: 100%;
  border-radius: 40px;
  padding: 11px;
  background: linear-gradient(170deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* The glow behind the device — the page's single bold moment. */
.phone::before {
  content: "";
  position: absolute;
  inset: -14% -22%;
  background: var(--shield-gradient);
  filter: blur(68px);
  opacity: 0.26;
  border-radius: 50%;
  z-index: -1;
}

.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(180deg, var(--canvas-top), var(--canvas) 52%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 16px 22px;
}

.shield {
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: var(--shield-gradient);
  box-shadow: 0 14px 34px rgba(17, 204, 209, 0.3);
}
.shield img { width: 60px; height: 60px; }

.status-card {
  width: 100%;
  border-radius: var(--r-md);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  padding: 13px 13px 9px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.status-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}
.status-time { margin-left: auto; color: var(--muted); font-weight: 500; }

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 224, 127, 0.5); }
  50%      { box-shadow: 0 0 0 7px rgba(43, 224, 127, 0); }
}

.status-rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.row:last-child { border-bottom: 0; }

.avatar {
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--canvas);
}
.avatar.a1 { background: var(--mint); }
.avatar.a2 { background: var(--aqua); }
.avatar.a3 { background: var(--gold); }

.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-main b  { font-size: 11.5px; font-weight: 600; }
.row-main em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  flex: none;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
.chip-safe { background: rgba(43, 224, 127, 0.16); color: var(--mint); }
.chip-info { background: rgba(41, 211, 232, 0.16); color: var(--aqua); }

.sos {
  margin-top: auto;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--alert);
  background: rgba(255, 77, 109, 0.14);
  border: 1px solid rgba(255, 77, 109, 0.42);
}

/* ===========================================================================
   grids & cards
   ========================================================================= */

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.card,
.panel {
  min-width: 0;
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover,
.panel:hover { border-color: var(--glass-strong); transform: translateY(-2px); }

.card p,
.panel p { font-size: 14.5px; line-height: 1.62; color: var(--muted); }

/* Icons carry the role colour: mint for safe, red for alarm, gold for
   time-based, aqua for everything social. */
.ico {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
}
.ico svg { width: 22px; height: 22px; }

.ico-mint  { background: rgba(43, 224, 127, 0.14); color: var(--mint); }
.ico-aqua  { background: rgba(41, 211, 232, 0.14); color: var(--aqua); }
.ico-alert { background: rgba(255, 77, 109, 0.14); color: var(--alert); }
.ico-gold  { background: rgba(225, 188, 75, 0.14); color: var(--gold); }

/* ===========================================================================
   3. steps
   ---------------------------------------------------------------------------
   Numbered because this genuinely is a sequence — you cannot share with a
   circle you have not built yet.
   ========================================================================= */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  counter-reset: step;
}

.step {
  min-width: 0;
  position: relative;
  padding: 28px 24px 26px;
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.step-n {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--canvas);
  background: var(--safe-gradient);
  margin-bottom: 4px;
}

.step p { font-size: 14.5px; line-height: 1.62; color: var(--muted); }

/* ===========================================================================
   4. notice
   ========================================================================= */

.notice {
  margin-top: 26px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: rgba(255, 77, 109, 0.08);
  border: 1px solid rgba(255, 77, 109, 0.34);
}

.notice-ico { flex: none; color: var(--alert); margin-top: 2px; }
.notice-ico svg { width: 24px; height: 24px; }

.notice h3 { color: var(--alert); margin-bottom: 6px; }
.notice p { font-size: 14.5px; line-height: 1.6; color: var(--text); opacity: 0.88; }

/* ===========================================================================
   5. faq
   ========================================================================= */

.faq { display: flex; flex-direction: column; gap: 10px; }

.faq details {
  border-radius: var(--r-md);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  padding: 4px 20px;
  transition: border-color 0.2s ease;
}
.faq details[open] { border-color: var(--glass-strong); }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  font-size: 15.5px;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.faq p {
  padding: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 62ch;
}

/* ===========================================================================
   6. support
   ========================================================================= */

.support-card {
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.support-contacts {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 10px;
}

.contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

.contact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--mint);
  overflow-wrap: anywhere;
}

/* ===========================================================================
   footer
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--glass-border);
  background: rgba(1, 32, 58, 0.5);
  padding-block: clamp(42px, 5vw, 64px) 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: clamp(30px, 4vw, 56px);
  padding-bottom: 36px;
}

.footer-brand { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.footer-note {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 40ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 26px;
  min-width: 0;
}

.footer-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }

.footer-col h4 {
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.footer-col a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.18s ease;
}
.footer-col a:hover { color: var(--mint); text-decoration: none; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-block: 18px 26px;
  border-top: 1px solid var(--glass-border);
  font-size: 12.5px;
  color: var(--muted);
}

/* ===========================================================================
   responsive
   ---------------------------------------------------------------------------
   The grids above collapse on their own through auto-fit. These breakpoints
   handle the two layouts that cannot: the hero's two columns and the footer's.
   ========================================================================= */

@media (max-width: 920px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  .hero-copy { order: 1; }
  .hero-art  { order: 2; }

  .footer-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .site-header { position: static; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav { width: 100%; gap: 2px; }
  .nav a { padding: 8px 10px; font-size: 13.5px; }
  .nav .nav-cta { margin-left: 0; }
}

@media (max-width: 440px) {
  body { font-size: 15.5px; }

  .card, .panel, .step { padding: 22px 19px; }
  .btn { width: 100%; }
  .cta-row { flex-direction: column; align-items: stretch; }

  .phone { width: min(260px, 100%); }
  .shield { width: 78px; height: 78px; border-radius: 24px; }
  .shield img { width: 50px; height: 50px; }

  .notice { flex-direction: column; gap: 12px; }
}
