/**
 * App-shell homepage — mobile-first, almost native app feel
 * Desktop inherits premium layout; mobile gets dock, sheets, large touch targets
 */

:root {
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-dock-h: 64px;
  --app-radius: 18px;
  --app-ink: #0b1f3a;
  --app-muted: #5b6b82;
  --app-line: #e2e8f0;
  --app-surface: #f4f7fb;
  --app-cta: #c2410c;
  --app-teal: #0f766e;
}

/* —— Base app home —— */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.app-home {
  background: #fff;
  padding-bottom: calc(var(--app-dock-h) + var(--app-safe-bottom) + 16px);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

@media (min-width: 901px) {
  body.app-home {
    padding-bottom: 0;
    overscroll-behavior-y: auto;
  }
  .app-dock,
  .app-sheet-handle,
  .app-status-bar {
    display: none !important;
  }
}

/* iOS status bar spacer when installed as PWA / notch devices */
.app-status-bar {
  display: none;
  height: var(--app-safe-top);
  background: #0b1f3a;
}

@media (max-width: 900px) {
  .app-status-bar {
    display: block;
  }

  /* Sticky glass header — feels like native nav */
  .app-home .app-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  }

  .app-home .app-header .container {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .app-home .logo-name {
    font-size: 1.05rem;
  }

  .app-home .logo-tagline {
    font-size: 0.68rem;
  }

  /* Horizontal trust chips scroll like app chips */
  .app-home .trust-proof-bar {
    position: sticky;
    top: 56px;
    z-index: 880;
    background: rgba(244, 247, 251, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--app-line);
  }

  .app-home .trust-proof-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.55rem 0;
    scroll-snap-type: x proximity;
  }

  .app-home .trust-proof-scroll::-webkit-scrollbar {
    display: none;
  }

  .app-home .trust-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--app-line);
    box-shadow: 0 1px 3px rgba(11, 31, 58, 0.04);
  }
}

/* Logo mark */
.logo-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #132f56, #1a4a8a);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.app-header-row {
  min-height: 60px;
}

/* —— Hero —— */
.app-hero {
  background: radial-gradient(120% 100% at 20% 0%, #1a3a66 0%, #0b1f3a 55%, #081628 100%);
  color: #fff;
  padding: 1.75rem 0 2.25rem;
}

.app-hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 901px) {
  .app-hero {
    padding: 3rem 0 3.5rem;
  }
  .app-hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.5rem;
    align-items: center;
  }
}

.app-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0c14b;
  margin: 0 0 0.65rem;
}

.app-hero h1 {
  color: #fff;
  font-size: clamp(1.75rem, 5.5vw, 2.65rem);
  line-height: 1.15;
  margin: 0 0 0.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.app-hero h1 em {
  font-style: normal;
  color: #f0c14b;
}

.app-hero-lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 34rem;
}

.app-hero-bullets {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.app-hero-bullets li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

.app-hero-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.app-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn-app-primary,
.btn-app-ghost,
.btn-app-ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  font-weight: 750;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-app-primary {
  background: var(--app-cta);
  color: #fff;
  box-shadow: 0 10px 24px rgba(194, 65, 12, 0.35);
}

.btn-app-primary:hover {
  background: #9a3412;
  color: #fff;
}

.btn-app-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn-app-ghost-light {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

/* Quote sheet — app card (override main.css 2-col lead-form grid) */
.app-quote-sheet,
.app-quote-sheet.lead-form {
  display: block !important;
  max-width: none !important;
  margin: 0 !important;
  background: #fff !important;
  color: var(--app-ink);
  border-radius: 22px !important;
  border: none !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28) !important;
  padding: 1.15rem 1.15rem 1.25rem !important;
  position: relative;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  gap: 0 !important;
}

.app-quote-sheet.lead-form::before {
  display: none !important;
}

.app-sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #d1d5db;
  margin: 0 auto 0.85rem;
}

@media (max-width: 900px) {
  .app-sheet-handle {
    display: block;
  }
  .app-quote-sheet {
    border-radius: 22px 22px 18px 18px !important;
  }
}

.app-quote-sheet .form-header {
  display: block !important;
  grid-area: auto !important;
  text-align: left;
  border-bottom: 1px solid var(--app-line);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.app-quote-sheet .form-header h2 {
  font-size: 1.35rem !important;
  margin: 0 0 0.25rem !important;
  color: var(--app-ink) !important;
}

.app-quote-sheet .form-header p {
  margin: 0 0 0.65rem !important;
  font-size: 0.9rem;
  color: var(--app-muted);
}

.app-quote-sheet .quote-form {
  display: block !important;
  grid-area: auto !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.app-quote-sheet .form-control {
  min-height: 50px;
  font-size: 16px; /* prevent iOS zoom */
  border-radius: 12px;
}

.app-quote-sheet .submit-btn {
  border-radius: 14px !important;
  min-height: 54px !important;
  background: var(--app-cta) !important;
  background-image: none !important;
  font-size: 1.05rem !important;
  width: 100%;
}

/* Sections */
.app-section {
  padding: 2.75rem 0;
}

.app-section-alt {
  background: var(--app-surface);
}

.section-kicker {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a4a8a;
  margin: 0 0 0.4rem;
  text-align: center;
}

.app-section h2,
.process-strip h2 {
  text-align: center;
  margin: 0 0 0.5rem;
  color: var(--app-ink);
}

.section-lead {
  text-align: center;
  color: var(--app-muted);
  max-width: 32rem;
  margin: 0 auto 1.75rem;
  font-size: 1.02rem;
}

.app-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 700px) {
  .app-proof-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.app-proof-card {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 1.15rem 1.2rem;
  box-shadow: 0 4px 14px rgba(11, 31, 58, 0.04);
}

.app-proof-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.app-proof-card p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.95rem;
}

.app-proof-card a {
  color: #1a4a8a;
  font-weight: 600;
}

/* Tiles */
.app-tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 800px) {
  .app-tile-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.app-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  padding: 1rem 0.95rem;
  text-decoration: none;
  color: inherit;
  min-height: 88px;
  box-shadow: 0 2px 10px rgba(11, 31, 58, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-tile:active {
  transform: scale(0.98);
}

.app-tile strong {
  font-size: 0.95rem;
  color: var(--app-ink);
  font-weight: 750;
}

.app-tile span {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.app-tile:hover {
  box-shadow: 0 10px 24px rgba(11, 31, 58, 0.08);
}

.app-center-note {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
}

.app-center-note a {
  color: #1a4a8a;
  font-weight: 650;
}

.app-narrow {
  max-width: 40rem;
}

/* FAQ */
.app-faq details {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.55rem;
}

.app-faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.app-faq summary::-webkit-details-marker {
  display: none;
}

.app-faq .faq-answer {
  margin-top: 0.65rem;
  color: var(--app-muted);
  font-size: 0.95rem;
}

/* Final CTA */
.app-final-cta {
  background: var(--app-ink);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}

.app-final-cta h2 {
  color: #fff;
  margin: 0 0 0.5rem;
}

.app-final-cta p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1.25rem;
}

.app-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Footer */
.app-footer {
  padding: 2.5rem 0 calc(1.5rem + var(--app-dock-h) + var(--app-safe-bottom));
}

@media (min-width: 901px) {
  .app-footer {
    padding-bottom: 2rem;
  }
}

.app-footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.75rem;
}

@media (min-width: 800px) {
  .app-footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.app-footer h3,
.app-footer h4 {
  color: #fff;
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.app-footer p,
.app-footer a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.app-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-footer .footer-links li {
  margin-bottom: 0.35rem;
}

/* —— MOBILE APP DOCK (iOS tab-bar feel) —— */
.app-dock {
  position: fixed;
  left: max(10px, env(safe-area-inset-left, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: calc(8px + var(--app-safe-bottom));
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  box-shadow:
    0 12px 40px rgba(11, 31, 58, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  padding: 6px;
  min-height: var(--app-dock-h);
}

.app-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--app-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 16px;
  min-height: 52px;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
  user-select: none;
}

.app-dock-item:active {
  background: var(--app-surface);
  transform: scale(0.96);
}

.app-dock-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-dock-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-dock-primary {
  color: #fff;
  background: linear-gradient(180deg, #d97706 0%, var(--app-cta) 100%);
  box-shadow: 0 6px 16px rgba(194, 65, 12, 0.35);
}

.app-dock-primary .app-dock-icon svg {
  stroke: #fff;
}

.app-dock-primary:active {
  background: #9a3412;
  color: #fff;
  transform: scale(0.96);
}

.app-dock-item.is-active:not(.app-dock-primary) {
  color: var(--app-ink);
  background: var(--app-surface);
}

/* Cookie sits above dock on mobile */
@media (max-width: 900px) {
  .app-home .cookie-consent,
  .app-cookie {
    bottom: calc(var(--app-dock-h) + 18px + var(--app-safe-bottom)) !important;
    left: 12px !important;
    right: 12px !important;
    border-radius: 16px !important;
    width: auto !important;
  }

  .app-home .sticky-mobile-cta {
    display: none !important; /* dock replaces sticky bar */
  }

  .hide-mobile {
    display: none !important;
  }

  /* Compact header on scroll feel */
  .app-header.scrolled {
    box-shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
  }

  .top-bar {
    display: none !important;
  }

  /* Larger touch targets in nav drawer */
  .header-nav .nav-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
  }
}

/* Menu button bars — mobile only (don't override desktop hide) */
.app-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--app-line);
  background: #fff;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media (max-width: 900px) {
  .app-menu-btn {
    display: inline-flex;
  }
}

.app-menu-btn .menu-bars,
.app-menu-btn .menu-bars::before,
.app-menu-btn .menu-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--app-ink);
  border-radius: 2px;
  position: relative;
}

.app-menu-btn .menu-bars::before,
.app-menu-btn .menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.app-menu-btn .menu-bars::before {
  top: -6px;
}

.app-menu-btn .menu-bars::after {
  top: 6px;
}

/* Quotes results inside sheet */
.app-quote-sheet .quotes-results {
  margin-top: 1rem;
}

/* Process steps — card stack on mobile */
@media (max-width: 900px) {
  .app-home .app-steps {
    display: grid;
    gap: 0.75rem;
  }

  .app-home .process-step {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 4px 14px rgba(11, 31, 58, 0.04);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.85rem;
    align-items: start;
  }

  .app-home .process-step .step-num {
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(145deg, #132f56, #1a4a8a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
  }

  .app-home .process-step h3 {
    margin: 0;
    font-size: 1rem;
    grid-column: 2;
  }

  .app-home .process-step p {
    margin: 0;
    grid-column: 2;
    font-size: 0.9rem;
    color: var(--app-muted);
  }

  /* Form groups feel denser / app-like */
  .app-quote-sheet .form-group label {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--app-muted);
    margin-bottom: 0.3rem;
  }

  .app-quote-sheet .quote-form-grid {
    gap: 0.75rem;
  }

  .app-quote-sheet .tcpa-consent {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--app-muted);
  }

  /* Pull quote sheet slightly over hero edge */
  .app-hero {
    padding-bottom: 1.5rem;
  }

  .app-hero-copy {
    padding-bottom: 0.25rem;
  }

  /* FAQ as full-width list rows */
  .app-faq summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-right: 0.25rem;
  }

  .app-faq summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--app-muted);
    flex-shrink: 0;
  }

  .app-faq details[open] summary::after {
    content: "−";
  }
}

/* Standalone PWA: hide browser chrome leftovers */
@media all and (display-mode: standalone) {
  .app-status-bar {
    display: block;
  }

  body.app-home {
    /* extra breathing room under notch */
    padding-top: 0;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .app-tile,
  .app-dock-item {
    transition: none;
  }
  .app-dock-item:active,
  .app-tile:active {
    transform: none;
  }
}
