/* ============================================================
   The Kindness Relay — Shared Stylesheet
   ============================================================ */

/* Google Fonts loaded in <head> to avoid render-blocking @import */

/* --- Variables -------------------------------------------- */
:root {
  --warm-cream:     #FFFFFF;
  --soft-peach:     rgba(218, 137, 147, 0.1);
  --coral:          #DA8993;
  --coral-deep:     #9D1F60;
  --sage:           #8DCDE6;
  --sage-deep:      #5BB0CC;
  --warm-brown:     #000000;
  --gold:           #8DCDE6;
  --gold-light:     rgba(141, 205, 230, 0.3);
  --text-dark:      #000000;
  --text-soft:      #4A4A4A;
  --white:          #ffffff;
  --border:         rgba(0, 0, 0, 0.10);
  --shadow-sm:      0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-md:      0 4px 24px rgba(0, 0, 0, 0.08);

  /* Section backgrounds */
  --bg-pink:        #F2D7D9;
  --bg-blue:        #D4EEF7;
  --bg-magenta:     #9D1F60;

  /* Text on coloured sections */
  --text-on-dark:   #FFFFFF;
  --text-on-pink:   #000000;
  --text-on-blue:   #000000;
  --text-on-magenta:#FFFFFF;

  --font-serif:     'cc-highjinkies-open', sans-serif;
  --font-sans:      'Barlow', system-ui, sans-serif;

  --radius-sm:      10px;
  --radius-md:      16px;
  --radius-lg:      20px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  background: var(--warm-cream);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* --- Layout containers ------------------------------------- */

/* Home & privacy pages — wider, centred */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Card scan pages (journey, add-stop) — narrow mobile */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography -------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--text-dark);
  text-transform: uppercase;
}

h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

h2 + p, h3 + p { margin-top: 0.5em; }
p + p { margin-top: 1em; }

p {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
}

a {
  color: var(--coral);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* --- Site header ------------------------------------------- */
.site-header {
  padding: 20px 0;
  border-bottom: 2px solid var(--text-dark);
}

.site-header .container,
.site-header .app {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
}

.logo span {
  color: var(--coral-deep);
}

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--coral); }

/* --- Site footer ------------------------------------------- */
.site-footer {
  margin-top: 0;
  padding: 32px 0;
  border-top: 2px solid var(--text-dark);
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-soft);
}

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

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border: 2px solid var(--text-dark);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
  width: 100%;
  text-align: center;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.btn:active { transform: scale(1); }

.btn-primary {
  background: var(--coral-deep);
  color: var(--white);
  border-color: var(--text-dark);
}
.btn-primary:hover {
  background: var(--white);
  color: var(--coral-deep);
  text-decoration: none;
}

.btn-secondary {
  background: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}
.btn-secondary:hover {
  background: var(--white);
  color: var(--text-dark);
  text-decoration: none;
}

.btn-on-dark {
  background: var(--white);
  color: var(--coral-deep);
  border-color: var(--white);
}
.btn-on-dark:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  text-decoration: none;
}

.btn-inline {
  width: auto;
  padding: 12px 24px;
  font-size: 0.9rem;
}

/* --- Cards ------------------------------------------------- */
.card {
  background: rgba(141, 205, 230, 0.15);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: none;
  border: 2px solid var(--text-dark);
}

.card-white {
  background: var(--white);
}

/* --- Pill / badge ------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--coral-deep);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Stat bubbles ------------------------------------------ */
.stats-row {
  display: flex;
  gap: 12px;
}

.stat-bubble {
  flex: 1;
  background: var(--bg-blue);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  box-shadow: none;
  border: 2px solid var(--text-dark);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--coral);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* --- Journey timeline ------------------------------------- */
.journey-timeline {
  position: relative;
  padding-left: 28px;
}

.journey-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--coral);
  border-radius: 2px;
}

.journey-stop {
  position: relative;
  padding: 0 0 24px 16px;
}

.journey-stop:last-child { padding-bottom: 0; }

.journey-stop::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid var(--warm-cream);
  box-shadow: 0 0 0 2px var(--coral);
}

.journey-stop.current::before {
  background: var(--sage);
  box-shadow: 0 0 0 2px var(--sage);
  animation: currentPulse 2s ease-in-out infinite;
}

@keyframes currentPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--sage); }
  50%       { box-shadow: 0 0 0 5px rgba(141, 205, 230, 0.3); }
}

.stop-location {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.stop-date {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.stop-note {
  font-size: 0.82rem;
  color: var(--coral);
  font-style: italic;
  margin-top: 4px;
}

/* --- Pending stops ---------------------------------------- */
.journey-stop.pending::before {
  background: var(--border);
  box-shadow: 0 0 0 2px var(--border);
}

.stop-pending-label {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-soft);
  opacity: 0.6;
  font-style: italic;
}

.story-stop.pending .story-stop-dot {
  background: var(--border);
}

/* --- Location detect button ------------------------------- */
.location-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.location-input-row input { flex: 1; }
.btn-locate {
  flex-shrink: 0;
  width: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-locate:hover { border-color: var(--coral); }
.btn-locate:disabled { opacity: 0.5; cursor: not-allowed; }

.location-hint {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 6px;
  line-height: 1.5;
}

/* --- Form styles ------------------------------------------ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-group .label-note {
  font-weight: 400;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--coral);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-soft);
  opacity: 0.7;
}

/* --- Hero logo -------------------------------------------- */
.hero-logo {
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 32px;
  max-width: none;
  width: min(1280px, 95vw);
  height: auto;
}

.hero-logo-sm {
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 24px;
  max-width: none;
  width: min(960px, 95vw);
  height: auto;
}

/* --- How it works steps ----------------------------------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral-deep);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Confirmation / success state ------------------------- */
.success-state {
  text-align: center;
  padding: 24px 0;
  display: none;
}

.success-state.visible { display: block; }

.success-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Card ID tag ------------------------------------------ */
.card-id-tag {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-soft);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 24px;
}

/* --- Section spacing -------------------------------------- */
.section {
  padding: 64px 0;
}

.section + .section {
  border-top: none;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--coral-deep);
  margin-bottom: 12px;
}

/* --- Section background utilities ------------------------- */
.section-pink {
  background: var(--bg-pink);
}
.section-pink h1,
.section-pink h2,
.section-pink h3,
.section-pink p,
.section-pink .section-label {
  color: var(--text-on-pink);
}
.section-pink .section-label {
  color: var(--coral-deep);
}

.section-blue {
  background: var(--bg-blue);
}
.section-blue h1,
.section-blue h2,
.section-blue h3,
.section-blue p,
.section-blue .section-label {
  color: var(--text-on-blue);
}
.section-blue .section-label {
  color: var(--coral-deep);
}

.section-magenta {
  background: var(--bg-magenta);
}
.section-magenta h1,
.section-magenta h2,
.section-magenta h3,
.section-magenta p {
  color: var(--text-on-magenta);
}
.section-magenta .section-label {
  color: rgba(255, 255, 255, 0.85);
}

/* Reset text inside white cards on coloured backgrounds */
.section-magenta .card-white h2,
.section-magenta .card-white h3,
.section-magenta .card-white p {
  color: var(--text-dark);
}
.section-magenta .card-white .section-label {
  color: var(--coral-deep);
}
.section-pink .card-white h2,
.section-pink .card-white h3,
.section-pink .card-white p {
  color: var(--text-dark);
}
.section-blue .card-white h2,
.section-blue .card-white h3,
.section-blue .card-white p {
  color: var(--text-dark);
}

/* --- Curved section dividers ------------------------------ */
.curve-divider {
  line-height: 0;
  font-size: 0;
  width: 100%;
  overflow: hidden;
}

.curve-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

@media (max-width: 480px) {
  .curve-divider svg {
    height: 40px;
  }
}

/* --- Page-level vertical spacing for card pages ---------- */
.page-body {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* --- Quote ------------------------------------------------- */
.quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-soft);
  line-height: 1.7;
  text-align: center;
  padding: 32px 0;
}

.quote cite {
  display: block;
  font-size: 0.8rem;
  margin-top: 8px;
  opacity: 0.6;
  font-style: normal;
}

/* --- Toast ------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--warm-brown);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 999;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Utility ---------------------------------------------- */
.text-center { text-align: center; }
.text-soft   { color: var(--text-soft); }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* --- reCAPTCHA widget -------------------------------------- */
.captcha-wrap {
  display: flex;
  justify-content: center;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .section { padding: 48px 0; }
}

@media (max-width: 480px) {
  .section { padding: 40px 0; }
  .stats-row { gap: 8px; }
  .stat-number { font-size: 1.6rem; }
  .card { padding: 20px; }
  .stat-bubble { padding: 16px 10px; }
  .btn { padding: 15px 24px; }
  .page-body { padding-top: 32px; padding-bottom: 48px; }
}

@media (max-width: 340px) {
  .captcha-wrap {
    transform: scale(0.9);
    transform-origin: center;
  }
}
