/* USO × Cloudflare — demo environment
   Brand: USO Navy #003087, Gold #FFB81C, White; Cloudflare Orange #F6821F
   ------------------------------------------------------------------ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --uso-navy:    #003087;
  --uso-navy-dk: #001f5b;
  --uso-gold:    #FFB81C;
  --uso-gold-lt: #FFD05C;
  --cf-orange:   #F6821F;
  --cf-orange-lt:#FFA45B;
  --white:       #ffffff;
  --off-white:   #f5f6fa;
  --gray-100:    #f0f1f5;
  --gray-300:    #d0d4e0;
  --gray-600:    #5a6070;
  --gray-900:    #1a1d2b;
  --text:        #1a1d2b;

  --font: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --transition: 0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--uso-gold); outline-offset: 2px; border-radius: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.1s;
  text-decoration: none;
  border: 2px solid transparent;
  letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--uso-gold);
  color: var(--uso-navy-dk);
  border-color: var(--uso-gold);
}
.btn-primary:hover { background: var(--uso-gold-lt); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

.btn-donate {
  background: var(--cf-orange);
  color: var(--white);
  border-color: var(--cf-orange);
  font-size: 1.05rem;
  padding: 0.9rem 2.5rem;
}
.btn-donate:hover { background: #e0711a; }

/* ── Site header ── */
.site-header {
  background: var(--uso-navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.uso-logo { height: 36px; width: auto; }

.logo-tagline {
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem;
  line-height: 1.2;
  max-width: 110px;
  letter-spacing: 0.01em;
}

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

.site-nav a {
  color: rgba(255,255,255,0.85);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.site-nav a:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.nav-donate {
  background: var(--uso-gold) !important;
  color: var(--uso-navy-dk) !important;
  font-weight: 700 !important;
}
.nav-donate:hover { background: var(--uso-gold-lt) !important; }

.staff-login-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  border: 1.5px solid rgba(255,255,255,0.2);
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: not-allowed;
  letter-spacing: 0.02em;
}
.staff-login-btn[data-active="true"] {
  color: var(--white);
  background: rgba(246,130,31,0.18);
  border-color: var(--cf-orange);
  cursor: pointer;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--uso-navy-dk) 0%, var(--uso-navy) 55%, #1a3a7a 100%);
  color: var(--white);
  padding: 4.5rem 1.5rem 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge { margin-bottom: 1.25rem; }
.badge-pill {
  display: inline-block;
  background: rgba(246,130,31,0.18);
  border: 1px solid var(--cf-orange);
  color: var(--cf-orange-lt);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Stat strip — gold bar at base of hero */
.hero-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--uso-gold);
  color: var(--uso-navy-dk);
  margin: 0 -1.5rem;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* ── Shared section utilities ── */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 900;
  color: var(--uso-navy);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--gray-600);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

/* ── Programs ── */
.programs-section { background: var(--off-white); }

.program-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.program-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.program-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--uso-gold);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  display: block;
}

.program-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--uso-navy);
  margin-bottom: 0.5rem;
}

.program-card p {
  font-size: 0.92rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.card-link {
  color: var(--uso-navy);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--uso-gold);
  padding-bottom: 1px;
  transition: color var(--transition), border-color var(--transition);
}
.card-link:hover { color: var(--cf-orange); border-color: var(--cf-orange); }

/* ── Location finder ── */
.locator-section { background: var(--uso-navy); color: var(--white); }
.locator-section h2 { color: var(--white); }
.locator-section .section-sub { color: rgba(255,255,255,0.7); }

.locator-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.locator-input {
  flex: 1;
  min-width: 220px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.locator-input::placeholder { color: rgba(255,255,255,0.45); }
.locator-input:focus { border-color: var(--uso-gold); background: rgba(255,255,255,0.16); }

.locator-results {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.locator-searching { margin-bottom: 0.5rem; }
.locator-hint { color: rgba(255,255,255,0.55); font-size: 0.85rem; }

.locator-sample h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--uso-gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.center-list { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }

.center-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 4px solid var(--uso-gold);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.93rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.55;
}
.center-item strong { color: var(--white); }

/* ── Impact ── */
.impact-section { background: var(--white); }

.impact-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.impact-copy h2 { margin-bottom: 1rem; }
.impact-copy p { color: var(--gray-600); margin-bottom: 1rem; max-width: 560px; }
.impact-copy .btn { margin-top: 1rem; }

.cloudflare-badge-block { flex-shrink: 0; }

.cf-badge {
  background: var(--gray-100);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  min-width: 220px;
  text-align: center;
}

.cf-logo { height: 20px; margin: 0 auto 0.75rem; }

.cf-badge-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 1rem;
}
.cf-badge-label strong { color: var(--gray-900); }

.cf-badge-list {
  list-style: none;
  text-align: left;
  font-size: 0.8rem;
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cf-badge-list li::before {
  content: '✓ ';
  color: var(--cf-orange);
  font-weight: 700;
}

/* ── Volunteer ── */
.volunteer-section { background: var(--off-white); }

.volunteer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.vol-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border-top: 4px solid var(--uso-gold);
}

.vol-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--uso-navy);
  margin-bottom: 0.5rem;
}

.vol-card p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.volunteer-cta { text-align: center; }

/* ── Donate ── */
.donate-section {
  background: var(--uso-navy-dk);
  color: var(--white);
}

.donate-inner {
  text-align: center;
}

.donate-inner h2 { color: var(--white); margin-bottom: 1rem; }
.donate-inner p { color: rgba(255,255,255,0.75); max-width: 560px; margin: 0 auto 2rem; }

.donate-amounts {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.amount-btn {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.25);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.amount-btn:hover { background: rgba(255,255,255,0.18); border-color: var(--uso-gold); }
.amount-btn.selected {
  background: var(--uso-gold);
  color: var(--uso-navy-dk);
  border-color: var(--uso-gold);
}

.donate-note {
  color: rgba(255,255,255,0.4);
  font-size: 0.78rem;
  margin-top: 1rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--uso-navy-dk);
  border-top: 3px solid var(--uso-gold);
  color: rgba(255,255,255,0.75);
  padding: 3rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.uso-logo-footer { height: 28px; width: auto; margin-bottom: 0.5rem; }
.footer-tagline { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-bottom: 1rem; }
.footer-legal { font-size: 0.75rem; color: rgba(255,255,255,0.4); line-height: 1.5; max-width: 280px; }

.footer-links h4 {
  color: var(--uso-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }

.footer-cf { text-align: right; }
.footer-cf-label { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-bottom: 0.5rem; }
.cf-footer-logo { height: 16px; margin-left: auto; }

/* ── SE panel ── */
#sePanel {
  background: var(--gray-100);
  border-top: 3px solid var(--cf-orange);
}

/* ── Chat widget ── */
#chatLaunch {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--uso-navy);
  color: var(--white);
  border: 2px solid var(--uso-gold);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: background var(--transition), box-shadow var(--transition);
  letter-spacing: 0.02em;
}
#chatLaunch:hover {
  background: var(--uso-gold);
  color: var(--uso-navy-dk);
}

#chatPanel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 360px;
  max-height: 520px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* open/close animation */
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
#chatPanel:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#chatPanel header {
  background: var(--uso-navy);
  color: var(--white);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
  border-bottom: 2px solid var(--uso-gold);
}

#chatClose {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}
#chatClose:hover { color: var(--white); }

#chatLog {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

/* Message bubbles injected by chat.js via .msg.user / .msg.assistant */
#chatLog .msg { max-width: 82%; line-height: 1.55; }
#chatLog .msg.user {
  align-self: flex-end;
  background: var(--uso-navy);
  color: var(--white);
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 2px 12px;
}
#chatLog .msg.assistant {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 12px 2px;
}
#chatLog .msg.blocked {
  align-self: flex-start;
  background: #fff0e0;
  border: 1px solid var(--cf-orange);
  color: #7a3800;
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 12px 2px;
  font-size: 0.85rem;
}

#chatForm {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--gray-300);
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
#chatInput:focus { border-color: var(--uso-navy); }

#chatSend {
  background: var(--uso-gold);
  color: var(--uso-navy-dk);
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}
#chatSend:hover { background: var(--uso-gold-lt); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .impact-inner { grid-template-columns: 1fr; }
  .cloudflare-badge-block { justify-self: center; }
  .footer-inner { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .footer-cf { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 600px) {
  .site-nav { display: none; }
  .hero-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  #chatPanel { width: calc(100vw - 2rem); right: 1rem; }
}

/* ── Favicon (inline SVG via CSS, not needed here — file below) ── */
