/* ==========================================================================
   CCRRD Kerala Relief — stylesheet
   Palette: paddy-field green, monsoon blue-grey, turmeric gold, coconut brown
   ========================================================================== */

:root {
  --color-bg:        #FAF7F1;
  --color-surface:   #FFFFFF;
  --color-ink:       #1C2B22;
  --color-ink-soft:  #4B5C52;
  --color-primary:   #1F4B3F;
  --color-primary-dark: #143229;
  --color-primary-soft: #E4EEE9;
  --color-secondary: #3A5A6B;
  --color-accent:    #D9A441;
  --color-accent-soft: #F6E7C6;
  --color-danger:    #B23A2E;
  --color-whatsapp:  #25A75B;
  --color-border:    #E4DFD3;

  --font-display: 'Baloo Chettan 2', 'Noto Sans Malayalam', sans-serif;
  --font-body: 'Inter', 'Noto Sans Malayalam', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(20, 40, 30, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 40, 30, 0.12);
  --container-w: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--color-primary-dark); line-height: 1.25; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--color-ink-soft); }
a { color: var(--color-primary); }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Main header ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-mark { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--color-primary-dark); letter-spacing: 0.02em; }
.brand-text small { color: var(--color-ink-soft); font-size: 0.72rem; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.lang-switch:hover { background: var(--color-accent-soft); transform: translateY(-1px); }

/* ---------- Sub header ---------- */
.sub-header {
  background: var(--color-primary);
  color: #fff;
}
.sub-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.sub-nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
.sub-nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.sub-nav-links a:hover,
.sub-nav-links a.active { color: #fff; border-bottom-color: var(--color-accent); }
.managed-by { color: rgba(255,255,255,0.7); font-size: 0.82rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, #1F4B3F 0%, #24594A 45%, #3A5A6B 100%);
  color: #fff;
  overflow: hidden;
  padding-bottom: 70px;
}
.hero-inner {
  padding: 72px 20px 90px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.hero-title {
  color: #fff;
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  max-width: 18ch;
  margin: 0 auto 0.4em;
}
.hero-subtitle {
  color: rgba(255,255,255,0.88);
  max-width: 52ch;
  margin: 0 auto 2em;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-waves {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 90px;
  z-index: 1;
  opacity: 0.5;
}
.hero-waves svg { width: 100%; height: 100%; }
.hero-waves path { fill: rgba(255,255,255,0.10); animation: wave-drift 14s ease-in-out infinite alternate; transform-origin: center; }
@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-30px); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-accent); color: var(--color-primary-dark); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #E7B75C; box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.12); }
.section .btn-outline { color: var(--color-primary); border-color: var(--color-primary); }
.section .btn-outline:hover { background: var(--color-primary-soft); }
.btn-ghost { background: transparent; color: var(--color-ink-soft); }
.btn-ghost:hover { color: var(--color-ink); }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-whatsapp { background: var(--color-whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1f9350; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.info-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
/* The class above sets display:flex, which otherwise overrides the
   browser's built-in "hidden" attribute rule. This line makes sure the
   modal is truly hidden until JS removes the [hidden] attribute. */
.modal-overlay[hidden] {
  display: none;
}
body.modal-open { overflow: hidden; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--color-accent-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-error {
  background: #FBEAE7;
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin: 12px 0 0;
}
.form-error-box {
  background: #FBEAE7;
  color: var(--color-danger);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label, .field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-ink);
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--color-ink);
}
.field input:focus, .field select:focus { border-color: var(--color-primary); }
.field select:disabled { background: #F3F1EC; color: #9AA39C; }
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  background: var(--color-surface);
}
.checkbox-pill:has(input:checked) {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}
.radio-row { display: flex; gap: 18px; align-items: center; padding-top: 4px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--color-ink-soft); }
.honeypot { position: absolute; left: -9999px; top: -9999px; }
.narrow { max-width: 720px; }
.subtitle { color: var(--color-ink-soft); margin-top: -6px; }

/* ---------- Results page ---------- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.results-count { color: var(--color-ink-soft); font-family: var(--font-body); font-weight: 500; font-size: 1rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.volunteer-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.volunteer-avatar {
  width: 46px; height: 46px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.volunteer-name { margin-bottom: 10px; font-size: 1.1rem; }
.volunteer-meta { display: flex; gap: 20px; margin: 0 0 16px; }
.volunteer-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-ink-soft); margin-bottom: 3px; }
.volunteer-meta dd { margin: 0; font-weight: 600; }
.badge {
  display: inline-block;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}
.volunteer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-ink-soft);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.empty-state svg { color: var(--color-secondary); margin-bottom: 14px; }

/* ---------- Thank-you card ---------- */
.thankyou-card {
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 50px 30px;
  box-shadow: var(--shadow-sm);
}
.thankyou-card svg { color: var(--color-primary); margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  font-size: 0.9rem;
}
.footer-grid p { color: rgba(255,255,255,0.75); margin: 0; }
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; color: #fff; margin-bottom: 8px; }
.sub-footer {
  background: #0F241D;
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  padding: 14px 0;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: left; }
}
@media (max-width: 640px) {
  .header-row { padding: 12px 16px; }
  .brand-text small { display: none; }
  .hero-inner { padding: 52px 16px 70px; }
  .field-grid { grid-template-columns: 1fr; }
  .modal { padding: 22px; }
  .sub-header-row { justify-content: center; text-align: center; }
  .managed-by { width: 100%; order: 2; }
  .results-header { flex-direction: column; align-items: flex-start; }
}
