/* ============================================
   North Shore Exterior Co. — Main Stylesheet
   Premium Design System v2
   ============================================ */

:root {
  --navy: #0B1D3A;
  --navy-light: #132B52;
  --navy-mid: #1A3A6B;
  --white: #FFFFFF;
  --off-white: #F7F8FA;
  --cream: #FAFBFD;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #DBEAFE;
  --coral: #E8553D;
  --text: #1E293B;
  --text-light: #64748B;
  --text-lighter: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --success: #16A34A;
  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.12);
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --transition-slow: .5s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-zh: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.65;
  background: var(--white);
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[lang="zh"] { font-family: var(--font-zh); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 10000;
  background: var(--navy); color: var(--white);
  padding: 12px 24px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* ---- ICON SYSTEM ---- */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  flex-shrink: 0;
}
.icon svg { width: 28px; height: 28px; stroke-width: 1.75; }
.icon--sm { width: 44px; height: 44px; border-radius: 11px; }
.icon--sm svg { width: 22px; height: 22px; }
.icon--lg { width: 68px; height: 68px; border-radius: 16px; }
.icon--lg svg { width: 34px; height: 34px; }

.icon--navy { background: var(--navy); color: var(--white); }
.icon--accent { background: var(--accent-light); color: var(--accent); }
.icon--ghost { background: rgba(255,255,255,.12); color: var(--white); }
.icon--white { background: var(--white); color: var(--navy); }

/* ---- HEADER ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3000;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition), border-color var(--transition);
  /* Safe area: notch / Dynamic Island */
  padding-top: env(safe-area-inset-top);
}
.site-header.scrolled {
  box-shadow: var(--shadow);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.1rem; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; letter-spacing: -.01em; min-width: 0; flex-shrink: 1;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--navy); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: var(--white);
  font-size: .85rem; font-weight: 800; letter-spacing: .02em;
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: .95rem; font-weight: 500; color: var(--text-light);
  transition: color var(--transition); position: relative;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px;
}

.lang-switch {
  display: flex; gap: 2px; margin-left: 12px;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.lang-switch a {
  padding: 4px 10px; font-size: .78rem; font-weight: 600;
  color: var(--text-light); transition: all var(--transition);
}
.lang-switch a:hover, .lang-switch a.active {
  background: var(--navy); color: var(--white);
}

.header-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--white) !important;
  padding: 9px 22px; border-radius: 6px; font-size: .85rem; font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.header-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

/* Mobile header lang pills */
.header-lang-mobile { display: none; }

@media (max-width: 900px) {
  .header-lang-mobile {
    display: flex; gap: 2px; margin-right: 8px; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  }
  .header-lang-mobile a {
    padding: 5px 9px; font-size: .72rem; font-weight: 600;
    color: var(--text-light); transition: all var(--transition);
  }
  .header-lang-mobile a:hover,
  .header-lang-mobile a.active { background: var(--navy); color: var(--white); }
}

/* Hide footer lang-switch always */
.footer-bottom .lang-switch { display: none; }

/* Mobile menu */
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 6px;
  transition: background var(--transition);
}
.menu-toggle:hover { background: var(--off-white); }
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-toggle span {
  display: block; width: 22px; height: 2px; background: var(--navy);
  margin: 5px 0; transition: var(--transition); border-radius: 2px;
}

/* Lock body scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
  /* No position:fixed — it breaks position:fixed children on iOS Safari */
}
html.nav-open { overflow: hidden; }

/* ---- NAV DEBUG BANNER (only with ?navdebug=1) ---- */
#nav-debug-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
  padding: 4px 12px; font: 600 13px/1.4 monospace;
  color: #fff; background: #222; text-align: center;
  pointer-events: none; transition: background .15s;
}

/* ---- FORCE: weather overlay never blocks taps ---- */
#wx-overlay { pointer-events: none !important; }

/* ---- MOBILE DRAWER (≤900px) ---- */

/* Backdrop — direct child of <body>, separate from drawer */
#nav-backdrop {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(8,20,45,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  touch-action: none; /* prevents scroll bleed to body on iOS */
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}
/* iOS Safari: if backdrop-filter causes issues, fall back to opaque overlay */
@supports not ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  #nav-backdrop { background: rgba(8,20,45,.72); }
}
#nav-backdrop.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 200ms ease, visibility 0s linear 0s;
}

/* Drawer — full-width dropdown below header (Telegram/WebView safe) */
#nav-drawer {
  position: fixed;
  top: calc(72px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 0 0 16px 16px;
  border-top: 1px solid rgba(12,24,48,.10);
  box-shadow: 0 16px 48px rgba(8,20,45,.18);
  z-index: 2200;
  opacity: 0;
  visibility: hidden; pointer-events: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
#nav-drawer.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 220ms ease, visibility 0s linear 0s;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: block; z-index: 3100;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  /* Hamburger → X */
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Hide original nav on mobile (content cloned into #nav-drawer) */
  .nav-links { display: none !important; }

  /* Drawer top bar */
  .drawer-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid rgba(12,24,48,.08);
    flex-shrink: 0; min-height: 64px;
  }
  .drawer-topbar-left {
    display: flex; align-items: center; gap: 10px;
  }
  .drawer-topbar-left img {
    width: 36px; height: 36px; object-fit: contain; border-radius: 6px;
  }
  .drawer-topbar-label {
    font-size: .88rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em;
  }
  .drawer-close {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; border-radius: 8px;
    color: var(--text-light); transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .drawer-close:hover { background: var(--off-white); color: var(--navy); }
  .drawer-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .drawer-close svg { width: 22px; height: 22px; }

  /* Nav link list */
  .drawer-nav-list {
    flex: 1; padding: 8px 0;
  }
  #nav-drawer a:not(.header-cta) {
    display: flex; align-items: center;
    font-size: 1.05rem; font-weight: 500; color: var(--text);
    padding: 14px 20px; min-height: 48px;
    border-bottom: 1px solid rgba(12,24,48,.08);
    transition: background var(--transition);
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  #nav-drawer a:not(.header-cta):last-child {
    border-bottom: none;
  }
  #nav-drawer a:not(.header-cta):hover,
  #nav-drawer a:not(.header-cta):active {
    background: rgba(20,90,200,.06);
  }

  /* Language selector — segmented pills */
  #nav-drawer .lang-switch {
    margin: 0; border: none; border-radius: 0; overflow: visible;
    padding: 12px 20px 8px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .lang-switch-label {
    font-size: .78rem; font-weight: 600; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .06em;
    display: block;
  }
  .lang-switch-pills {
    display: flex; gap: 8px;
  }
  #nav-drawer .lang-switch a {
    flex: 1; display: flex; align-items: center; justify-content: center;
    height: 40px; border-radius: 12px;
    border: 1px solid rgba(12,24,48,.12);
    font-size: .88rem; font-weight: 600; color: var(--navy);
    background: var(--white);
    transition: all var(--transition);
    padding: 0; min-height: auto;
  }
  #nav-drawer .lang-switch a:hover { border-color: rgba(12,24,48,.25); }
  #nav-drawer .lang-switch a.active {
    background: #0B2A5B; color: var(--white); border-color: #0B2A5B;
  }

  /* CTA at bottom */
  .drawer-cta-wrap {
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); flex-shrink: 0;
    margin-top: auto;
  }
  #nav-drawer .header-cta {
    display: flex; width: 100%; justify-content: center;
    height: 48px; border-radius: 10px; font-size: .95rem;
  }
}

/* Desktop: hide drawer/backdrop entirely */
@media (min-width: 901px) {
  #nav-backdrop, #nav-drawer { display: none !important; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  #nav-drawer, #nav-backdrop { transition: none !important; }
}

/* ---- HERO ---- */
.hero {
  padding: calc(140px + env(safe-area-inset-top)) 0 88px;
  background: linear-gradient(168deg, var(--navy) 0%, var(--navy-light) 60%, var(--navy-mid) 100%);
  color: var(--white); text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(37,99,235,.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(37,99,235,.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -27px; left: 0; right: 0; height: 80px;
  background: var(--white); clip-path: ellipse(55% 100% at 50% 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.12;
  margin-bottom: 20px; letter-spacing: -.03em;
}
.hero p {
  font-size: 1.15rem; opacity: .8; max-width: 560px; margin: 0 auto 24px;
  line-height: 1.7;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius); font-size: .9rem;
  font-weight: 600; cursor: pointer; border: none; transition: all var(--transition);
  text-align: center; justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.btn-primary {
  background: var(--accent); color: var(--white);
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.btn-primary:hover {
  background: var(--accent-hover); transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
}
.btn-secondary {
  background: rgba(255,255,255,.1); color: var(--white);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
}
.btn-secondary svg { width: 18px; height: 18px; }

/* ---- TRUST STRIP ---- */
.trust-strip {
  padding: 28px 0;
  background: var(--white);
  position: relative; z-index: 2;
}
.trust-items {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
}
.trust-item {
  padding: 12px 8px;
}
.trust-item .icon { margin: 0 auto 16px; width: 72px; height: 72px; border-radius: 18px; }
.trust-item .icon svg { width: 36px; height: 36px; }
.trust-label { font-size: 1.2rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.trust-sub { font-size: 1.05rem; color: var(--text-light); margin-top: 4px; line-height: 1.5; }

@media (max-width: 700px) {
  .trust-items { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .trust-item { padding: 16px 10px; }
}

/* ---- SECTION SHARED ---- */
.section { padding: 48px 0; }
.section-alt { background: var(--off-white); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; text-align: center;
  margin-bottom: 12px; color: var(--navy); letter-spacing: -.02em;
  line-height: 1.2;
}
.section-sub {
  text-align: center; color: var(--text-light); max-width: 540px;
  margin: 0 auto 28px; font-size: 1.05rem; line-height: 1.7;
}

/* ---- SERVICES ---- */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.service-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
a.service-card { text-decoration: none; color: inherit; cursor: pointer; }
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent); opacity: 0; transition: opacity var(--transition);
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-card:hover::before { opacity: 1; }

.service-card .icon { margin-bottom: 8px; }
.service-card h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 4px;
  color: var(--navy); letter-spacing: -.01em;
}
.service-card p {
  font-size: .88rem; color: var(--text-light); line-height: 1.5; margin-bottom: 0;
}

@media (max-width: 800px) {
  .services-grid { grid-template-columns: 1fr; gap: 6px; }
  .service-card { display: flex; flex-direction: row; align-items: center; padding: 10px 16px; gap: 16px; }
  .service-card .icon { flex-shrink: 0; margin-bottom: 0; width: 42px; height: 42px; border-radius: 10px; }
  .service-card .icon svg { width: 21px; height: 21px; }
  .service-card p { display: none; }
  .service-card h3 { font-size: 1.2rem; margin-bottom: 0; flex: 1; }
}

/* ---- PORTFOLIO ---- */
.portfolio-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.portfolio-item {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: var(--navy); aspect-ratio: 4/3;
  box-shadow: var(--shadow);
}
.portfolio-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.portfolio-item:hover img { transform: scale(1.06); }
.portfolio-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 32px 20px 18px;
  background: linear-gradient(transparent, rgba(11,29,58,.9));
  color: var(--white);
}
.portfolio-caption strong { display: block; font-size: .95rem; margin-bottom: 2px; }
.portfolio-caption span { font-size: .78rem; opacity: .75; }

@media (max-width: 700px) { .portfolio-grid { grid-template-columns: 1fr; } }

/* ---- WHY US ---- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.why-item {
  display: flex; gap: 16px; padding: 16px 18px;
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.why-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}
.why-item .icon { flex-shrink: 0; margin-top: 2px; }
.why-item h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.why-item p { font-size: .95rem; color: var(--text-light); line-height: 1.6; }

@media (max-width: 700px) { .why-grid { grid-template-columns: 1fr; } }

/* ---- REFERRAL ---- */
.referral-card {
  max-width: 680px; margin: 0 auto;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white); border-radius: var(--radius-xl); padding: 56px 48px;
  text-align: center; position: relative; overflow: hidden;
}
.referral-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 80% 0%, rgba(37,99,235,.2), transparent);
  pointer-events: none;
}
.referral-card > * { position: relative; }
.referral-card h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.referral-card p { opacity: .8; margin-bottom: 28px; line-height: 1.7; }
.referral-badge {
  display: inline-block; background: rgba(255,255,255,.12);
  padding: 12px 32px; border-radius: 40px; font-size: 1.3rem; font-weight: 800;
  border: 1px solid rgba(255,255,255,.18);
  letter-spacing: .02em;
}

/* ---- AREA CARDS (non-clickable) ---- */
.area-card { cursor: default; }
.area-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
.area-card:hover::before { opacity: 0; }
.area-card p { font-size: .88rem; color: var(--text-light); line-height: 1.6; margin-bottom: 0; }

/* ---- PARTNERS ---- */
.partners-grid {
  display: flex; gap: 48px; justify-content: center; align-items: flex-start; flex-wrap: wrap;
}
.partner-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
  transition: transform var(--transition);
}
.partner-card:hover { transform: translateY(-3px); }
.partner-logo {
  width: 180px; height: 80px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.partner-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.partner-logo--lg img { transform: scale(1.3); }
.partner-card:hover .partner-logo { border-color: var(--accent-light); box-shadow: var(--shadow); }
.partner-name {
  font-size: .82rem; font-weight: 600; text-align: center;
  color: var(--navy); max-width: 180px; line-height: 1.4;
}
.partner-desc {
  font-size: .76rem; color: var(--text-light); text-align: center; margin-top: -4px;
}

/* ---- ESTIMATE FORM ---- */
.form-section {
  padding: 48px 0;
  background: var(--off-white);
}
.form-wrapper {
  max-width: 720px; margin: 0 auto;
  background: var(--white); border-radius: var(--radius-xl);
  padding: 32px 32px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; }
.form-group label {
  font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: 6px;
}
.form-group label .req { color: var(--coral); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; min-width: 0;
  padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .92rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white); color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: var(--text-lighter); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group textarea { resize: vertical; min-height: 100px; }

.form-submit {
  width: 100%; padding: 16px; margin-top: 12px;
  background: var(--accent); color: var(--white); border: none;
  border-radius: var(--radius); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.form-submit:hover {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
}
.form-submit:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.form-submit:disabled {
  opacity: .6; cursor: not-allowed; transform: none;
}

.form-success {
  display: none; text-align: center; padding: 48px 24px;
}
.form-success.show { display: block; }
.form-success .checkmark-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: #DCFCE7; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.form-success .checkmark-icon svg { width: 32px; height: 32px; color: var(--success); }
.form-success h3 { font-size: 1.4rem; color: var(--navy); margin-bottom: 10px; font-weight: 700; }
.form-success p { color: var(--text-light); line-height: 1.7; }

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Flatpickr overrides — match form design */
.flatpickr-wrapper { display: block; width: 100%; }
.flatpickr-input { cursor: pointer; width: 100%; }
.flatpickr-calendar {
  font-family: var(--font) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  border: 1px solid var(--border) !important;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.flatpickr-day:hover { background: var(--accent-light) !important; }
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays, span.flatpickr-weekday {
  background: var(--accent) !important;
  color: var(--white) !important;
  fill: var(--white) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--white) !important; }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: var(--white) !important; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: rgba(255,255,255,.7) !important; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .form-wrapper { padding: 32px 20px; }
  /* iOS Safari: prevent auto-zoom on input focus (font-size must be ≥16px) */
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,.7);
  padding: 72px 0 calc(32px + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 48px;
}
.footer-brand .logo { color: var(--white); margin-bottom: 14px; }
.footer-brand p { font-size: .88rem; line-height: 1.75; }
.footer-col h4 {
  color: var(--white); font-size: .82rem; font-weight: 700; margin-bottom: 18px;
  text-transform: uppercase; letter-spacing: .08em;
}
.footer-col a {
  display: block; font-size: .88rem; padding: 5px 0;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }
.footer-contacts a {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
}
.footer-contacts .ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
}
.footer-contacts .ic svg { width: 16px; height: 16px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: .8rem;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---- SCROLL REVEAL ---- */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: .05s; }
.reveal:nth-child(3) { transition-delay: .1s; }
.reveal:nth-child(4) { transition-delay: .15s; }
.reveal:nth-child(5) { transition-delay: .2s; }
.reveal:nth-child(6) { transition-delay: .25s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }

/* ---- FOCUS VISIBLE ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ---- THANK YOU PAGE ---- */
.thankyou-section {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px; text-align: center;
}
.thankyou-card {
  max-width: 520px; margin: 0 auto;
}
.thankyou-card .checkmark-icon {
  width: 80px; height: 80px; margin: 0 auto 28px;
  background: #DCFCE7; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.thankyou-card .checkmark-icon svg { width: 40px; height: 40px; color: var(--success); }
.thankyou-card h1 { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.thankyou-card p { font-size: 1.05rem; color: var(--text-light); line-height: 1.7; margin-bottom: 32px; }
.thankyou-card .btn { padding: 14px 36px; }

/* ---- BRAND LOGO ---- */
/* Header: logo mark — plain image */
.brand-logo {
  width: 56px; height: 56px;
  object-fit: contain; display: block; flex-shrink: 0;
}
.logo .logo-name {
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
  letter-spacing: -.01em; line-height: 1.25;
}

/* Footer: full lockup at readable size */
.footer-brand .brand-logo {
  width: 200px; height: auto;
  object-fit: contain; display: block;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .section { padding: 32px 0; }
  .trust-strip { padding: 16px 0; }
  .form-section { padding: 32px 0; }
  .section-sub { margin-bottom: 20px; }
  .hero { padding-bottom: 96px; }
  .referral-card { padding: 28px 20px; }
}

@media (max-width: 600px) {
  .brand-logo { width: 48px; height: 48px; }
  .logo .logo-name { font-size: 1rem; }
  .footer-brand .brand-logo { width: 160px; }
  .hero { padding-top: calc(88px + env(safe-area-inset-top)); padding-bottom: 96px; }
  .section { padding: 28px 0; }
  .trust-strip { padding: 12px 0; }
  .form-section { padding: 28px 0; }
  .section-sub { margin-bottom: 16px; }
}

/* ---- WEATHER / TIME-OF-DAY REACTIVE BACKGROUND ---- */
/* Single overlay — CSS-only, no canvas/particles */
#wx-overlay {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  will-change: transform, opacity;
  contain: layout paint;
}
html.wx-ready #wx-overlay { opacity: .35; }
@media (max-width: 768px) {
  html.wx-ready #wx-overlay { opacity: .22; }
}

/* ---- Day / Night base ---- */
html.wx-night {
  --hero-bg: linear-gradient(168deg, #040A16 0%, #081228 60%, #0A1630 100%);
}
html.wx-day {
  --hero-bg: linear-gradient(168deg, var(--navy) 0%, var(--navy-light) 60%, var(--navy-mid) 100%);
}
html.wx-night .hero { background: var(--hero-bg); }
html.wx-day   .hero { background: var(--hero-bg); }
html.wx-night body  { background: #F3F4F7; }

/* ---- CLEAR DAY — warm sun orb + drift ---- */
html.wx-clear.wx-day #wx-overlay {
  background:
    radial-gradient(ellipse 50% 40% at 75% 15%, rgba(251,191,36,.3) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 25% 80%, rgba(37,99,235,.1) 0%, transparent 65%);
}
@keyframes wx-clear-day {
  0%, 100% { opacity: .35; transform: translate(0, 0)       scale(1); }
  50%      { opacity: .40; transform: translate(-25px, 15px) scale(1.04); }
}
html.wx-clear.wx-day #wx-overlay { animation: wx-clear-day 14s ease-in-out infinite; }
@media (max-width: 768px) {
  @keyframes wx-clear-day-m {
    0%, 100% { opacity: .22; transform: translate(0, 0)       scale(1); }
    50%      { opacity: .28; transform: translate(-15px, 10px) scale(1.03); }
  }
  html.wx-clear.wx-day #wx-overlay { animation-name: wx-clear-day-m; }
}

/* ---- CLEAR NIGHT — deep navy + static grain ---- */
html.wx-clear.wx-night #wx-overlay {
  background-color: rgba(4,10,22,.22);
  background-image:
    radial-gradient(1.2px 1.2px at 8% 15%,  rgba(255,255,255,.55) 50%, transparent 50%),
    radial-gradient(1px   1px   at 22% 68%, rgba(255,255,255,.4)  50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 47% 8%,  rgba(255,255,255,.5)  50%, transparent 50%),
    radial-gradient(1px   1px   at 65% 42%, rgba(255,255,255,.35) 50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 83% 72%, rgba(255,255,255,.45) 50%, transparent 50%),
    radial-gradient(1px   1px   at 14% 88%, rgba(255,255,255,.3)  50%, transparent 50%),
    radial-gradient(1px   1px   at 56% 92%, rgba(255,255,255,.4)  50%, transparent 50%),
    radial-gradient(1px   1px   at 38% 30%, rgba(255,255,255,.32) 50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 91% 18%, rgba(255,255,255,.38) 50%, transparent 50%),
    radial-gradient(1px   1px   at 72% 55%, rgba(255,255,255,.28) 50%, transparent 50%);
  background-size: 220px 220px;
}
html.wx-ready.wx-clear.wx-night #wx-overlay { opacity: .40; }

/* ---- CLOUDY — haze drift ---- */
html.wx-cloudy #wx-overlay {
  background:
    radial-gradient(ellipse 130% 65% at 25% 25%, rgba(148,163,184,.24) 0%, transparent 55%),
    radial-gradient(ellipse 110% 55% at 75% 70%, rgba(148,163,184,.18) 0%, transparent 55%);
}
@keyframes wx-cloudy-drift {
  0%, 100% { opacity: .30; transform: translateX(0); }
  50%      { opacity: .40; transform: translateX(-70px); }
}
html.wx-cloudy #wx-overlay { animation: wx-cloudy-drift 16s ease-in-out infinite; }
@media (max-width: 768px) {
  @keyframes wx-cloudy-drift-m {
    0%, 100% { opacity: .20; transform: translateX(0); }
    50%      { opacity: .28; transform: translateX(-40px); }
  }
  html.wx-cloudy #wx-overlay { animation-name: wx-cloudy-drift-m; }
}

/* ---- RAIN — glass sheen sliding ---- */
html.wx-rain #wx-overlay {
  background:
    linear-gradient(165deg,
      rgba(100,140,200,.2)  0%,
      rgba(37,99,235,.12)   30%,
      transparent            50%,
      rgba(100,140,200,.16) 70%,
      rgba(37,99,235,.1)    100%),
    repeating-linear-gradient(180deg,
      rgba(255,255,255,.035) 0px, transparent 2px, transparent 5px);
  background-size: 100% 100%, 100% 110px;
}
@keyframes wx-rain-sheen {
  0%   { opacity: .32; transform: translateY(0); }
  50%  { opacity: .40; transform: translateY(110px); }
  100% { opacity: .32; transform: translateY(0); }
}
html.wx-rain #wx-overlay { animation: wx-rain-sheen 10s ease-in-out infinite; }
@media (max-width: 768px) {
  @keyframes wx-rain-sheen-m {
    0%   { opacity: .20; transform: translateY(0); }
    50%  { opacity: .28; transform: translateY(70px); }
    100% { opacity: .20; transform: translateY(0); }
  }
  html.wx-rain #wx-overlay { animation-name: wx-rain-sheen-m; }
}

/* ---- SNOW — frosty veil + drift ---- */
html.wx-snow #wx-overlay {
  background:
    radial-gradient(ellipse 100% 65% at 45% 20%, rgba(210,225,255,.24) 0%, transparent 60%),
    linear-gradient(180deg, rgba(230,240,255,.14) 0%, transparent 45%);
}
@keyframes wx-snow-drift {
  0%, 100% { opacity: .30; transform: translateX(0); }
  50%      { opacity: .40; transform: translateX(-40px); }
}
html.wx-snow #wx-overlay { animation: wx-snow-drift 14s ease-in-out infinite; }
@media (max-width: 768px) {
  @keyframes wx-snow-drift-m {
    0%, 100% { opacity: .20; transform: translateX(0); }
    50%      { opacity: .28; transform: translateX(-25px); }
  }
  html.wx-snow #wx-overlay { animation-name: wx-snow-drift-m; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  #wx-overlay { animation: none !important; transition: none !important; }
}

/* ---- Weather pill ---- */
.wx-pill {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 100;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(11,29,58,.75); backdrop-filter: blur(8px);
  color: rgba(255,255,255,.7); padding: 6px 14px;
  border-radius: 20px; font-size: .72rem; font-weight: 500;
  letter-spacing: .02em; pointer-events: none;
  opacity: 0; transition: opacity .5s ease;
}
html.wx-ready .wx-pill { opacity: 1; }
.wx-pill .wx-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
}
@media (max-width: 600px) {
  .wx-pill {
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: calc(12px + env(safe-area-inset-right));
    font-size: .68rem; padding: 5px 10px;
  }
}
