/* FlashAware public marketing pages (client/public/*.html).
 *
 * These pages are plain HTML so crawlers and AI search bots (which do not
 * execute JavaScript) can read them; the React SPA's Landing.tsx is what the
 * Vite dev server shows and the two share this palette. Everything here must
 * satisfy the enforcing CSP in server/middleware/securityHeaders.ts:
 * style-src 'self' (this file), script-src 'self' (site.js), font-src 'self'
 * (so no web fonts — system stack below). */

:root {
  --bg: #0a1929;
  --bg-deep: #04101e;
  --card: rgba(19, 47, 76, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e3eaf3;
  --muted: #9fb0c3;
  --accent: #fbc02d;
  --accent-hover: #f9a825;
  --blue: #7cc4ff;
  --green: #66bb6a;
  --red: #ef5350;
  --radius: 10px;
  --max: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Safety net under the body gradient: anything the gradient does not cover
   * (and iOS Safari, which ignores fixed attachments) stays dark. */
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0%, #1c3a64 0%, var(--bg) 55%, var(--bg-deep) 100%)
    no-repeat;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 25, 41, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

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

.brand svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a.outline {
  border: 1px solid rgba(255, 255, 255, 0.35);
}

@media (max-width: 720px) {
  .site-nav a.hide-sm {
    display: none;
  }
}

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.2;
  transition:
    box-shadow 200ms,
    background-color 200ms;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 18px rgba(251, 192, 45, 0.35);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  box-shadow: 0 0 28px rgba(251, 192, 45, 0.55);
}

.btn-outline {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ---- Hero -------------------------------------------------------------- */

.hero {
  padding: 64px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

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

.hero .lead {
  font-size: 1.2rem;
  color: var(--muted);
  margin-top: 18px;
}

.hero h1 .glow {
  background: linear-gradient(90deg, #fbc02d 0%, #ffe082 60%, #fff59d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(46, 125, 50, 0.18);
  color: #a5d6a7;
  margin-bottom: 16px;
}

.chip[hidden] {
  display: none;
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

.chip.degraded {
  background: rgba(158, 158, 158, 0.18);
  color: #e0e0e0;
}

.chip.degraded .dot {
  background: #9e9e9e;
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chip .dot {
    animation: none;
  }
}

/* Honesty callout — used on every page that mentions speed. */
.honesty {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--blue);
  background: rgba(124, 196, 255, 0.08);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}

.honesty strong {
  color: #fff;
}

/* ---- Storm illustration (pure SVG, no assets) --------------------------- */

.storm-art {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.45));
}

/* ---- Sections ---------------------------------------------------------- */

.section {
  padding: 40px 0;
}

.section-tight {
  padding: 24px 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 880px) {
  .grid-3,
  .grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid-2,
  .grid-3,
  .grid-5 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition:
    transform 200ms,
    border-color 200ms,
    box-shadow 200ms;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 196, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: rgba(124, 196, 255, 0.12);
  margin-bottom: 14px;
  font-size: 1.2rem;
}

a.card {
  color: var(--text);
  text-decoration: none;
  display: block;
}

/* Risk-state strip */
.state {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left-width: 3px;
}

.state strong {
  display: block;
  font-size: 0.95rem;
}

.state span {
  font-size: 0.85rem;
  color: var(--muted);
}

.state-clear {
  background: rgba(46, 125, 50, 0.12);
  border-left-color: #2e7d32;
}

.state-prepare {
  background: rgba(251, 192, 45, 0.12);
  border-left-color: #fbc02d;
}

.state-stop {
  background: rgba(211, 47, 47, 0.12);
  border-left-color: #d32f2f;
}

.state-hold {
  background: rgba(237, 108, 2, 0.12);
  border-left-color: #ed6c02;
}

.state-degraded {
  background: rgba(158, 158, 158, 0.12);
  border-left-color: #9e9e9e;
}

/* Steps */
.step {
  display: flex;
  gap: 16px;
}

.step .num {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: rgba(124, 196, 255, 0.12);
  border: 1px solid rgba(124, 196, 255, 0.25);
  font-weight: 700;
}

/* Comparison table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

@media (max-width: 560px) {
  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 8px;
  }
}

/* Pricing */
.price-grid {
  align-items: stretch;
}

.price {
  position: relative;
}

.price.featured {
  border-color: rgba(251, 192, 45, 0.5);
  box-shadow: 0 0 40px rgba(251, 192, 45, 0.1);
}

.price .tag {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.price .amount {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0 2px;
}

.price .per {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.price ul {
  padding-left: 18px;
  margin: 0 0 18px;
}

.price li {
  margin: 6px 0;
}

/* CTA banner */
.cta {
  text-align: center;
  padding: 36px 24px;
  border: 1px solid rgba(251, 192, 45, 0.35);
  background: rgba(251, 192, 45, 0.06);
  box-shadow: 0 0 40px rgba(251, 192, 45, 0.12);
  border-radius: var(--radius);
}

.cta .btn {
  margin-top: 16px;
}

/* FAQ */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  background: rgba(19, 47, 76, 0.35);
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
}

/* Forms */
form {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.field .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.consent-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(0, 0, 0, 0.15);
}

.consent-box p {
  font-size: 0.9rem;
  color: var(--muted);
}

.form-msg {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.form-msg.ok {
  background: rgba(46, 125, 50, 0.2);
  color: #a5d6a7;
}

.form-msg.err {
  background: rgba(211, 47, 47, 0.2);
  color: #ef9a9a;
}

/* Honeypot: kept out of sight for humans, visible to naive bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Legal pages */
.legal {
  max-width: 820px;
}

.legal h2 {
  margin-top: 36px;
  font-size: 1.35rem;
}

.legal ol,
.legal ul {
  padding-left: 22px;
}

.legal li {
  margin: 6px 0;
}

.callout {
  border: 1px solid rgba(251, 192, 45, 0.4);
  background: rgba(251, 192, 45, 0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 24px;
}

@media (max-width: 720px) {
  .site-footer .cols {
    grid-template-columns: 1fr 1fr;
  }
}

.site-footer h4 {
  color: var(--text);
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin: 4px 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

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

.site-footer .fine {
  margin-top: 24px;
  font-size: 0.8rem;
}
