:root {
  --bg: #e5e7eb;
  --surface: #ffffff;
  --surface-alt: #f0f4f8;
  --text: #0f172a;
  --muted: #4b5563;
  --border: #e5e7eb;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --font: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --green: #22c55e;
  --blue: #2563eb;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.page-shell {
  width: min(1800px, calc(100vw - 64px));
  min-height: calc(100vh - 64px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 48px 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

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

.identity {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-gap: 18px;
  align-items: center;
}

.logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.brand h1 {
  margin: 6px 0;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.brand .eyebrow {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand .lede {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
  justify-items: stretch;
  align-items: stretch;
  width: 100%;
}

.cards-grid .tool-card {
  min-height: 320px;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
}

.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: #cfd8e3;
  background: var(--surface-alt);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.tool-card h2 {
  margin: 10px 0 8px;
  font-size: 22px;
}

.tool-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.card-topper,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 600;
  margin-top: auto;
}

.site-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.login-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  background: var(--surface-alt);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.login-link:hover {
  background: #e8edf3;
  border-color: #cfd8e3;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.user-menu {
  position: relative;
  display: none;
}

.user-menu.active {
  display: inline-flex;
}

.user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-weight: 700;
  cursor: pointer;
}

.user-toggle:hover {
  background: #e8edf3;
  border-color: #cfd8e3;
}

.user-caret {
  font-size: 12px;
  color: #475569;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 105%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 8px;
  display: none;
  min-width: 160px;
  z-index: 30;
}

.user-dropdown.open {
  display: grid;
  gap: 6px;
}

.dropdown-item {
  border: none;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  appearance: none;
}

.dropdown-item:hover {
  background: #e5e7eb;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.plan-name {
  margin: 0;
  font-size: 20px;
}

.plan-price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.plan-desc {
  margin: 0;
  color: var(--muted);
}

.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
}

.action-btn {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  background: #f8fafc;
  width: 100%;
  margin-top: auto;
}

.action-btn.open {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  min-height: 60vh;
}

.app-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.app-map {
  background: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 520px;
  height: 520px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

.cta-link {
  text-decoration: none;
  font-weight: 700;
}

.cta-link.bike { color: var(--green); }
.cta-link.transit { color: var(--blue); }
.cta-link.safety { color: var(--amber); }

.tool-card.bike {
  border-top: 4px solid var(--green);
}

.tool-card.transit {
  border-top: 4px solid var(--blue);
}

.tool-card.safety {
  border-top: 4px solid var(--amber);
}

.card-topper.bike {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.card-topper.transit {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.card-topper.safety {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
  color: var(--muted);
}

.hero-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.page-shell.narrow {
  max-width: 900px;
}

@media (max-width: 720px) {
  body {
    padding: 28px 12px;
  }

  .page-shell {
    padding: 30px 22px;
    width: 100%;
    min-height: auto;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .identity {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 28px;
  }

  main {
    align-items: flex-start;
  }
}

/* Auth modal */
.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.auth-backdrop.active {
  display: flex;
}

.auth-modal {
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  width: min(420px, 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
  padding: 24px;
  position: relative;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.auth-tab {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: #e0e7ff;
  border-color: #cbd5e1;
}

.auth-body {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f9fbfd;
}

.auth-form {
  display: none;
  gap: 12px;
  margin-top: 4px;
}

.auth-form.active {
  display: grid;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.auth-title {
  margin: 0;
  font-size: 22px;
}

.auth-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #334155;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 14px;
  color: #475569;
}

.form-field input[type=\"email\"],
.form-field input[type=\"password\"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.muted-link {
  font-size: 14px;
  color: #475569;
  text-decoration: none;
}

.title-divider {
  width: 100%;
  height: 2px;
  background: #5b33c0;
  border-radius: 12px;
  margin: 8px 0 18px;
}

.stay-logged {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
}
