:root {
  color-scheme: light dark;
  --color-bg: #ffffff;
  --color-fg: #1a1a1a;
  --color-muted: #5f6368;
  --color-border: #e0e0e0;
  --color-accent: #1a56db;
  --color-flash-error-bg: #fdecea;
  --color-flash-error-fg: #7a1c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-fg);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-fg);
  text-decoration: none;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.35rem;
  object-fit: contain;
}

.main-nav a,
.main-nav .nav-placeholder {
  margin-left: 1.25rem;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--color-accent);
}

.flash-messages {
  padding: 0 1.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.flash-error {
  background: var(--color-flash-error-bg);
  color: var(--color-flash-error-fg);
}

.content {
  flex: 1;
  padding: 3rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--color-muted);
}

.hero .hero-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.landing-view {
  color-scheme: light;
  background: #ffffff;
  color: #172033;
}

.landing-view .content {
  max-width: 1100px;
  padding: 5rem 1.5rem 4rem;
}

.landing-hero {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.75rem;
  color: #1a56db;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.landing-intro {
  max-width: 700px;
  margin: 1.5rem auto 2rem;
  color: #566176;
  font-size: 1.2rem;
  line-height: 1.7;
}

.pilot-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 680px;
  padding: 0.75rem 1rem;
  margin: 0 auto 1.5rem;
  border: 1px solid #cddcff;
  border-radius: 10px;
  background: #f5f8ff;
  color: #4a5870;
  text-align: left;
}

.pilot-notice p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pilot-badge {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #dce7ff;
  color: #1747a6;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  background: #1a56db;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgb(26 86 219 / 20%);
}

.primary-cta:hover {
  background: #1648b8;
}

.primary-cta:focus-visible,
.privacy-callout a:focus-visible {
  outline: 3px solid #93b4fd;
  outline-offset: 3px;
}

.trust-summary {
  display: flex;
  justify-content: center;
  gap: 0.6rem 1.6rem;
  padding: 0;
  margin: 1.25rem 0 0;
  color: #667085;
  font-size: 0.9rem;
  list-style: none;
}

.trust-summary li::before {
  content: "\2713";
  margin-right: 0.4rem;
  color: #087a55;
  font-weight: 700;
}

.landing-section {
  margin-top: 6rem;
}

.landing-section > h2,
.section-heading-row h2,
.privacy-callout h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.step-card {
  padding: 1.5rem;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 22px rgb(30 41 59 / 5%);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #1a56db;
  font-weight: 800;
}

.step-card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
}

.step-card p,
.privacy-callout p {
  margin: 0;
  color: #667085;
  line-height: 1.6;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.example-label {
  color: #667085;
  font-size: 0.78rem;
}

.example-list {
  margin-top: 1.75rem;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 28px rgb(30 41 59 / 6%);
}

.example-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #e6ebf1;
}

.example-item:last-child {
  border-bottom: 0;
}

.example-item p {
  margin: 0.25rem 0 0;
  color: #667085;
  font-size: 0.92rem;
}

.priority-pill {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.priority-urgent {
  background: #feecec;
  color: #a61b1b;
}

.priority-today {
  background: #fff3d6;
  color: #875b00;
}

.priority-later {
  background: #e8f3ff;
  color: #175b9c;
}

.example-action {
  color: #344054;
  font-size: 0.85rem;
  font-weight: 600;
}

.privacy-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 6rem;
  padding: 2rem;
  border-radius: 16px;
  background: #eff5ff;
}

.privacy-callout p:not(.section-kicker) {
  max-width: 700px;
  margin-top: 0.75rem;
}

.privacy-callout a {
  flex: 0 0 auto;
  color: #1a56db;
  font-weight: 700;
}

.error-page {
  text-align: center;
}

.debug-detail {
  text-align: left;
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.site-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

.footer-brand-logo {
  display: block;
  width: 8rem;
  height: auto;
  margin: 0 auto 0.75rem;
}

.site-footer .footer-links {
  margin-bottom: 0.5rem;
}

.site-footer .footer-links a {
  color: var(--color-muted);
  text-decoration: none;
  margin: 0 0.5rem;
}

.site-footer .footer-links a:hover {
  color: var(--color-accent);
}

.site-footer .footer-links .link-button {
  margin: 0 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: inherit;
  cursor: pointer;
}

.site-footer .footer-links .link-button:hover {
  color: var(--color-accent);
}

.cookie-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 100;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-fg);
  box-shadow: 0 6px 24px rgb(0 0 0 / 15%);
  font-size: 0.9rem;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0 0 0.75rem;
}

.cookie-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cookie-banner button {
  padding: 0.45rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.cookie-banner button[data-analytics-choice="denied"] {
  background: transparent;
  color: var(--color-accent);
}

.contact-view {
  color-scheme: light;
  background: #f7f9fb;
}

.contact-view .content {
  max-width: 668px;
  padding: 18px 24px;
}

.contact-page {
  padding: 48px 45px 41px;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 3px 16px rgb(30 41 59 / 5%);
}

.contact-page h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
}

.contact-page .tagline {
  margin: 0;
  color: #64748b;
  font-size: 18px;
  line-height: 1.5;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 34px;
}

.contact-form label {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  margin-bottom: 6px;
}

.contact-form .required {
  color: inherit;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="password"],
.contact-form textarea {
  font: inherit;
  width: 100%;
  min-width: 0;
  padding: 11px 15px;
  margin-bottom: 42px;
  border: 1px solid #c7d5e8;
  border-radius: 9px;
  background: #f7f9fb;
  color: #1e293b;
  font-size: 18px;
  line-height: 24px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #64748b;
  opacity: 1;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.contact-form button:focus-visible {
  outline: 3px solid #93b4fd;
  outline-offset: 3px;
  border-color: #2563eb;
}

.contact-form textarea {
  height: 147px;
  min-height: 147px;
  margin-bottom: 40px;
  resize: vertical;
}

.contact-form button {
  width: 100%;
  min-height: 47px;
  padding: 12px 20px;
  border: none;
  border-radius: 9px;
  background: #2563eb;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contact-form button:hover {
  background: #1d4ed8;
}

.contact-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.contact-success {
  background: #ecfdf5;
  color: #065f46;
}

.privacy-policy {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.privacy-policy h2 {
  margin-top: 2rem;
}

.privacy-policy li {
  margin-bottom: 0.5rem;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.admin-pilot {
  max-width: 1100px;
  margin: 0 auto;
}

.admin-logout {
  margin: 0 0 1rem;
}

.admin-note {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.range-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.range-tabs a {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.range-tabs a.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fafbfc;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.metric-label {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.admin-section {
  margin-top: 2rem;
}

.admin-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.admin-table th {
  color: var(--color-muted);
  font-weight: 600;
}

.admin-table-users th a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--color-muted);
}

.admin-alerts {
  margin-top: 1.5rem;
}

.alert-none {
  color: var(--color-muted);
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.alert {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 0.88rem;
}

.alert-critical {
  background: var(--color-flash-error-bg);
  border-color: #f3c4c4;
}

.alert-warning {
  background: #fff8e6;
  border-color: #f0dca0;
}

.alert-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.alert-badge-critical {
  background: #a61b1b;
  color: #ffffff;
}

.alert-badge-warning {
  background: #875b00;
  color: #ffffff;
}

.alert-message {
  flex: 1 1 auto;
}

.alert-time {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.status-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-active {
  background: #e6f4ea;
  color: #1e7e34;
}

.status-disconnected {
  background: #f1f3f4;
  color: #5f6368;
}

.status-reconnect_required {
  background: #fff3d6;
  color: #875b00;
}

.status-never_connected {
  background: #f1f3f4;
  color: #5f6368;
}

@media (max-width: 720px) {
  .metric-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .landing-view .content {
    padding-top: 3.5rem;
  }

  .trust-summary,
  .privacy-callout,
  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pilot-notice {
    align-items: flex-start;
  }

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

  .example-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .example-action {
    grid-column: 2;
  }

  .landing-section,
  .privacy-callout {
    margin-top: 4rem;
  }

  .contact-view .content {
    padding: 18px 16px;
  }

  .contact-page {
    padding: 32px 24px;
  }

  .contact-form input[type="text"],
  .contact-form input[type="email"] {
    margin-bottom: 30px;
  }

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

  .main-nav a,
  .main-nav .nav-placeholder {
    margin-left: 0;
    margin-right: 1rem;
  }
}

/* Data & privacy settings: destructive actions */
.privacy-settings form {
  margin-bottom: 1.5rem;
}

.privacy-settings button.danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
