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

:root {
  --navy:         #0a0f2e;
  --navy-mid:     #1e1b4b;
  --indigo:       #4f46e5;
  --indigo-dark:  #4338ca;
  --indigo-pale:  #eef2ff;
  --gold:         #f59e0b;
  --white:        #ffffff;
  --off-white:    #f8fafc;
  --slate-100:    #f1f5f9;
  --slate-200:    #e2e8f0;
  --slate-300:    #cbd5e1;
  --slate-400:    #94a3b8;
  --slate-600:    #475569;
  --slate-800:    #1e293b;
  --green:        #10b981;
  --green-pale:   #d1fae5;
  --red:          #ef4444;
  --red-pale:     #fee2e2;
  --radius-sm:    10px;
  --radius:       18px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:    0 20px 40px -8px rgba(0,0,0,.12), 0 8px 16px -4px rgba(0,0,0,.06);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--off-white);
  color: var(--slate-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 25% 70%, rgba(99,102,241,.28) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 15%, rgba(245,158,11,.14) 0%, transparent 50%),
    linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 55%, #312e81 100%);
  color: white;
  padding: 0 24px 72px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 44px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(255,255,255,.8);
}

.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.3);
  color: #fcd34d;
  border-radius: 100px;
  padding: 6px 18px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-content {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -.03em;
  margin-bottom: 22px;
  color: white;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #fcd34d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255,255,255,.65);
  max-width: 500px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 100px;
  padding: 14px 32px;
  backdrop-filter: blur(10px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
}

.stat-label {
  font-size: .68rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 34px;
  background: rgba(255,255,255,.13);
}

.hero-scroll-hint {
  margin-top: 52px;
  font-size: 1.1rem;
  color: rgba(255,255,255,.25);
  animation: bounce 2.2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* ── Main layout ──────────────────────────────────────────────────────────── */

main {
  max-width: 580px;
  margin: -36px auto 0;
  padding: 0 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  border: 1px solid var(--slate-200);
}

.card-header {
  margin-bottom: 28px;
}

.card-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.card-subheading {
  font-size: .875rem;
  color: var(--slate-400);
}

/* ── Form fields ──────────────────────────────────────────────────────────── */

.field {
  margin-bottom: 20px;
}

.field:last-of-type {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.required { color: var(--red); margin-left: 2px; }

.optional {
  font-size: .72rem;
  font-weight: 500;
  color: var(--slate-400);
  background: var(--slate-100);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-family: inherit;
  color: var(--slate-800);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: white;
}

input[type="email"]:focus,
input[type="tel"]:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.hint {
  font-size: .78rem;
  color: var(--slate-400);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Location search ──────────────────────────────────────────────────────── */

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

#location-search {
  width: 100%;
  padding: 12px 15px 12px 38px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-family: inherit;
  outline: none;
  background: white;
  color: var(--slate-800);
  transition: border-color .15s, box-shadow .15s;
}

#location-search:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

#location-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: white;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-200) transparent;
}

.loc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
  font-size: .875rem;
}

.loc-item:not(.loc-loading):hover { background: var(--indigo-pale); }

.loc-loading {
  color: var(--slate-400);
  font-size: .85rem;
  padding: 14px;
  cursor: default;
}

.loc-item input[type="checkbox"] {
  accent-color: var(--indigo);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.loc-name { font-weight: 600; color: var(--slate-800); font-size: .875rem; }
.loc-state { color: var(--slate-400); font-size: .78rem; margin-top: 2px; }

/* ── Selected location chips ──────────────────────────────────────────────── */

#selected-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--indigo-pale);
  color: var(--indigo);
  border: 1px solid rgba(79,70,229,.2);
  border-radius: 100px;
  padding: 4px 8px 4px 12px;
  font-size: .8rem;
  font-weight: 600;
}

.chip button {
  background: rgba(79,70,229,.15);
  border: none;
  cursor: pointer;
  color: var(--indigo);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  line-height: 1;
  padding: 0;
  transition: background .1s;
}

.chip button:hover { background: rgba(79,70,229,.28); }

/* ── Notification options ─────────────────────────────────────────────────── */

.notif-options {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
}

.notif-row:last-child { border-bottom: none; }

.notif-icon {
  font-size: 1.05rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.notif-label {
  flex: 1;
  font-size: .875rem;
  font-weight: 500;
  color: var(--slate-800);
}

.notif-label span {
  display: block;
  font-size: .76rem;
  font-weight: 400;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0;
  background: var(--slate-200);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .slider { background: var(--indigo); }
.toggle input:checked + .slider::before { transform: translateX(20px); }
.toggle input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: -.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
  width: 100%;
  box-shadow: 0 4px 16px rgba(79,70,229,.38);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(79,70,229,.5);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
}

.btn-outline:hover {
  background: var(--slate-100);
  border-color: var(--slate-300);
}

.btn-install {
  background: white;
  color: var(--indigo);
  padding: 10px 20px;
  font-size: .875rem;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 700;
}

.btn-install:hover { background: var(--indigo-pale); }

.form-footer-note {
  text-align: center;
  font-size: .78rem;
  color: var(--slate-400);
  margin-top: 14px;
}

/* ── Status banner ────────────────────────────────────────────────────────── */

#status-banner {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
}

#status-banner.success { display: block; background: var(--green-pale); color: #065f46; border: 1px solid #a7f3d0; }
#status-banner.error   { display: block; background: var(--red-pale);   color: #991b1b; border: 1px solid #fca5a5; }
#status-banner.info    { display: block; background: var(--indigo-pale); color: var(--indigo); border: 1px solid #c7d2fe; }

/* ── Manage section ───────────────────────────────────────────────────────── */

#manage-section { display: none; }

.card-manage {
  text-align: center;
  padding: 44px 32px;
}

.manage-icon {
  width: 56px;
  height: 56px;
  background: var(--green-pale);
  color: var(--green);
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.card-manage h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -.03em;
  margin-bottom: 10px;
}

.card-manage p {
  font-size: .9rem;
  color: var(--slate-400);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Install card ─────────────────────────────────────────────────────────── */

.card-install {
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border: none;
}

.install-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card-install h3 {
  font-size: .95rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.card-install p {
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
}

/* ── Features ─────────────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: .875rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.feature p {
  font-size: .8rem;
  color: var(--slate-400);
  line-height: 1.65;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  text-align: center;
  color: var(--slate-400);
  font-size: .76rem;
  padding: 20px 16px 48px;
  line-height: 2;
}

footer a { color: var(--slate-600); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

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

  .hero-stats {
    gap: 18px;
    padding: 12px 22px;
  }

  .hero {
    padding: 0 16px 60px;
  }

  .card {
    padding: 24px 20px;
  }

  .card-manage {
    padding: 36px 20px;
  }
}

/* ── Pricing grid ─────────────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.plan-card {
  background: white;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 24px 20px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.plan-card--pro {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo), var(--shadow);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.plan-name {
  font-size: .72rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}

.plan-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -.04em;
  margin-bottom: 18px;
}

.plan-price span {
  font-size: .875rem;
  font-weight: 400;
  color: var(--slate-400);
  letter-spacing: 0;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan-features li {
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
}

.plan-features li.yes { color: var(--slate-800); }
.plan-features li.yes::before { content: '✓'; background: var(--green-pale); color: var(--green); }
.plan-features li.no { color: var(--slate-300); }
.plan-features li.no::before { content: '×'; background: var(--slate-100); color: var(--slate-300); }

/* ── Pro inline badge ─────────────────────────────────────────────────────── */

.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Locked notification rows ─────────────────────────────────────────────── */

.notif-row--locked { opacity: .5; pointer-events: none; }

.lock-badge {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Tier chip ────────────────────────────────────────────────────────────── */

.tier-chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.tier-chip--free {
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.tier-chip--pro {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
}

/* ── Manage section ───────────────────────────────────────────────────────── */

#manage-section { display: none; }

.manage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.manage-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -.03em;
  margin-bottom: 4px;
}

.manage-header p {
  font-size: .875rem;
  color: var(--slate-400);
}

/* ── Upgrade CTA ──────────────────────────────────────────────────────────── */

.upgrade-cta {
  background: var(--indigo-pale);
  border: 1px solid rgba(79,70,229,.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.upgrade-cta p {
  font-size: .875rem;
  color: var(--indigo-dark);
  margin: 0;
  font-weight: 500;
}

.btn-upgrade {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
  padding: 10px 20px;
  font-size: .875rem;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

.btn-upgrade:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79,70,229,.5);
}

.btn-upgrade:disabled { opacity: .55; cursor: not-allowed; }

/* ── Manage actions ───────────────────────────────────────────────────────── */

.manage-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .upgrade-cta { flex-direction: column; align-items: flex-start; }
}
