/*
 * ShareCar public-site overrides: accessible colours, focus states, tap targets and
 * the styles for server-rendered pages (delete-account, 404, FAQ).
 *
 * The Firestore templates declare their colours on :root inside a <style> that comes
 * later in the page; "html:root" has higher specificity, so these values win.
 *
 * #00B050 on white is 2.87:1 (fails WCAG AA). #007A36 is 5.47:1 on white and
 * 4.97:1 on #F3F4F6, so it passes for normal-size text and white-on-green buttons.
 */
html:root {
  --sc-primary: #007A36;
  --pm-primary: #007A36;
  --sc-dark: #006B31;
  --pm-dark: #006B31;
  --pm-gray: #4B5563;      /* was #6B7280: 4.39:1 on #F3F4F6 */
  --sc-focus: #007A36;
}

/* On the dark footer (#111827) the original green is the accessible one (6.19:1). */
.sc-footer { --sc-primary: #00B050; }
/* White icons on a green fill inside the footer still need the darker green. */
.sc-footer .sc-to-top,
.sc-footer .sc-social-icon:hover { --sc-primary: #007A36; }

/* Inline colours in the landing template that fail contrast on white. */
.pm-glass-card span[style*="#888" i] { color: #6B7280 !important; }            /* 3.54:1 -> 4.83:1 */
.pm-glass-card small[style*="#F59E0B" i] { color: #B45309 !important; }        /* 2.15:1 -> 5.02:1 */
.pm-stat-item p { color: #4B5563; }

/* Focus visibility (the templates had no focus styles and removed the range outline). */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--sc-focus, #007A36);
  outline-offset: 2px;
}
.sc-footer a:focus-visible { outline-color: #34D399; }
html input[type="range"]:focus-visible { outline: 3px solid var(--sc-focus, #007A36); outline-offset: 4px; }

/* Persona tabs: the radios were display:none, so the tabs could not be reached by keyboard.
   Keep them in the tab order but visually hidden; arrow keys switch between them. */
html input[name="pm-persona"] {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}
#tab-passenger:focus-visible ~ .pm-tabs-wrapper label[for="tab-passenger"],
#tab-driver:focus-visible ~ .pm-tabs-wrapper label[for="tab-driver"] {
  outline: 3px solid var(--sc-focus, #007A36);
  outline-offset: 2px;
}

/* Tap targets: at least 44px for icon-only controls. */
.sc-header .sc-mobile-toggle { min-width: 44px; min-height: 44px; }
.sc-footer .sc-social-icon { width: 44px; height: 44px; }
.sc-static-nav a { display: inline-block; padding: 12px 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Skip link */
.sc-skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 2000;
  padding: 10px 16px;
  background: #111827;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}
.sc-skip-link:focus { top: 8px; color: #fff; }
#body-template:focus { outline: none; }

/* Server-rendered simple pages (delete-account, 404, fallback hero) */
.sc-page, .sc-fallback-hero { padding-top: 110px; padding-bottom: 48px; max-width: 820px; }
.sc-page h1, .sc-fallback-hero h1 { font-size: 2rem; font-weight: 800; color: #111827; margin-bottom: 1rem; }
.sc-page h2 { font-size: 1.35rem; font-weight: 700; color: #111827; margin: 2rem 0 0.75rem; }
.sc-page p, .sc-page li { color: #374151; line-height: 1.6; }
.sc-page a, .sc-fallback-hero a, .sc-faq a, .sc-callout a { color: #007A36; text-decoration: underline; }
.sc-link-list li { margin-bottom: 8px; }

.sc-form { margin: 1.5rem 0; padding: 24px; border: 1px solid #E5E7EB; border-radius: 12px; background: #F9FAFB; }
.sc-field { margin-bottom: 16px; }
.sc-field label { display: block; font-weight: 600; color: #111827; margin-bottom: 6px; }
.sc-field input[type="email"],
.sc-field input[type="tel"],
.sc-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #6B7280;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.sc-field [aria-invalid="true"] { border-color: #B91C1C; }
.sc-check { display: flex; gap: 10px; align-items: flex-start; }
.sc-check input { margin-top: 5px; width: 20px; height: 20px; flex: 0 0 auto; }
.sc-check label { font-weight: 500; }
.sc-btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: #007A36;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.sc-btn:hover { background: #006B31; }
.sc-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.sc-alert { padding: 14px 18px; border-radius: 10px; margin: 1rem 0; }
.sc-alert ul { margin: 0.5rem 0 0; }
.sc-alert-success { background: #ECFDF5; border: 1px solid #047857; color: #064E3B; }
.sc-alert-error { background: #FEF2F2; border: 1px solid #B91C1C; color: #7F1D1D; }

/* How-it-works FAQ and privacy callout (server-rendered under the CMS body) */
.sc-faq, .sc-callout { margin-top: 2.5rem; }
.sc-faq h2, .sc-callout h2 { font-size: 1.5rem; font-weight: 700; color: #111827; margin-bottom: 1rem; }
.sc-faq-item { border: 1px solid #E5E7EB; border-radius: 12px; margin-bottom: 12px; background: #fff; }
.sc-faq-item summary { padding: 16px 20px; font-weight: 600; cursor: pointer; color: #111827; }
.sc-faq-item p { padding: 0 20px 16px; margin: 0; color: #374151; line-height: 1.6; }

/* Carpool route pages (/carpool, /carpool/{from}-to-{to}) */
.sc-breadcrumb { font-size: 0.9rem; color: #6B7280; margin-bottom: 0.75rem; }
.sc-breadcrumb a { color: #007A36; }
.sc-route .sc-lead { font-size: 1.1rem; }
.sc-route .sc-note { font-size: 0.9rem; color: #6B7280; }
.sc-route-facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 1rem 0 0.25rem; }
.sc-ride-list { list-style: none; padding: 0; }
.sc-ride { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 14px; border: 1px solid #E5E7EB; border-radius: 10px; margin-bottom: 8px; }
.sc-ride time { font-weight: 700; color: #111827; }
.sc-empty-rides { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px; padding: 14px 18px; }
.sc-store-badge { display: inline-block; background: #111827; color: #fff !important; text-decoration: none !important; padding: 10px 18px; border-radius: 8px; font-weight: 600; }
.sc-route-links { padding-left: 1.2rem; }
.sc-route-links li { margin-bottom: 4px; }
.sc-faq h3 { font-size: 1.05rem; font-weight: 700; color: #111827; margin: 1.25rem 0 0.4rem; }
