/* ============================================================
   ROSCA / Chama Calculator — Design System & Styles
   Palette: East-African-rooted  |  Mobile-first  |  <40 KB
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
  /* Colors */
  --forest:      #1B4332;
  --forest-light:#2D6A4F;
  --gold:        #D4A017;
  --gold-light:  #E8C547;
  --terracotta:  #B54A3F;
  --cream:       #FBF7F0;
  --cream-dark:  #F0E8D8;
  --dark:        #2D2D2D;
  --muted:       #5C6B73;
  --success:     #2D6A4F;
  --success-bg:  rgba(45,106,79,0.10);
  --error:       #D32F2F;
  --error-bg:    rgba(211,47,47,0.08);
  --white:       #FFFFFF;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Spacing */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27,67,50,0.08);
  --shadow-md: 0 4px 16px rgba(27,67,50,0.10);
  --shadow-lg: 0 8px 32px rgba(27,67,50,0.14);
  --shadow-glass: 0 8px 32px rgba(27,67,50,0.12);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--gold); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--forest);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-top: var(--sp-3xl); margin-bottom: var(--sp-lg); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin-top: var(--sp-xl); margin-bottom: var(--sp-md); }

p { margin-bottom: var(--sp-md); }

::selection { background: var(--gold-light); color: var(--forest); }

/* Focus outlines — accessibility */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Layout Container ------------------------------------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.section { padding: var(--sp-3xl) 0; }

/* --- Skip Link (a11y) ------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-md);
  background: var(--forest);
  color: var(--white);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: var(--sp-md); }

/* --- Header / Nav ----------------------------------------- */
.site-header {
  background: var(--forest);
  padding: var(--sp-sm) 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
}
.site-logo img { width: 32px; height: 32px; }
.site-logo:hover { color: var(--gold-light); }

.header-nav { display: flex; align-items: center; gap: var(--sp-lg); }
.header-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--duration) var(--ease);
}
.header-nav a:hover { color: var(--gold-light); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-xl);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.lang-btn:hover {
  color: var(--white);
}

.lang-btn.active {
  background: var(--gold);
  color: var(--forest);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* --- Hero ------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
  color: var(--white);
  padding: var(--sp-3xl) 0 var(--sp-2xl);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212,160,23,0.12) 0%, transparent 70%);
  border-radius: var(--radius-full);
  pointer-events: none;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-content { max-width: 600px; }
.hero h1 { color: var(--white); margin-bottom: var(--sp-sm); }
.hero-swahili {
  font-size: 1.05rem;
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: var(--sp-md);
  font-weight: 500;
}
.hero-trust {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: var(--sp-lg);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--gold);
  color: var(--forest);
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--duration) var(--ease);
  box-shadow: 0 4px 16px rgba(212,160,23,0.3);
}
.hero-cta:hover {
  background: var(--gold-light);
  color: var(--forest);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212,160,23,0.4);
}
.hero-image {
  max-width: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .hero .container { grid-template-columns: 1fr 1fr; }
  .hero-image { justify-self: end; }
}

/* --- Calculator Card -------------------------------------- */
.calculator-section {
  padding: var(--sp-3xl) 0;
  background: var(--cream);
}
.calculator-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-glass);
}
.calculator-card h2 {
  margin-top: 0;
  margin-bottom: var(--sp-xs);
  font-size: 1.5rem;
}
.calculator-subtitle {
  color: var(--muted);
  margin-bottom: var(--sp-xl);
  font-size: 0.95rem;
}

/* --- Form Inputs ------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .form-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.form-group { position: relative; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--forest);
  margin-bottom: var(--sp-xs);
}
.form-label .label-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid rgba(27,67,50,0.15);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
  outline: none;
}
.form-input.is-error,
.form-textarea.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

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

.form-error {
  display: none;
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: var(--sp-xs);
}
.form-error.visible { display: block; }

.names-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  margin-top: var(--sp-xs);
}
.names-count-badge.hidden { display: none; }

.names-toggle {
  display: inline-block;
  color: var(--gold);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--sp-xs);
  transition: color var(--duration) var(--ease);
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 0;
}
.names-toggle:hover { color: var(--terracotta); }

.individual-names { margin-top: var(--sp-sm); }
.individual-names .name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}
.individual-names .name-row input { flex: 1; }
.individual-names .name-row .remove-name {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: color var(--duration) var(--ease);
}
.individual-names .name-row .remove-name:hover { color: var(--error); }
.add-name-btn {
  background: none;
  border: 2px dashed rgba(27,67,50,0.2);
  color: var(--forest-light);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  width: 100%;
  transition: all var(--duration) var(--ease);
}
.add-name-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,160,23,0.05);
}

/* Radio group */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}
.radio-option {
  position: relative;
}
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-option label {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(27,67,50,0.15);
  border-radius: var(--radius-xl);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.radio-option input[type="radio"]:checked + label {
  border-color: var(--gold);
  background: rgba(212,160,23,0.1);
  color: var(--forest);
}
.radio-option input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.radio-option label:hover {
  border-color: var(--gold);
  color: var(--forest);
}
.radio-disabled label {
  opacity: 0.45;
  cursor: not-allowed;
}
.coming-soon-tag {
  font-size: 0.7rem;
  background: var(--cream-dark);
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 100px;
  margin-left: 6px;
  font-weight: 500;
  vertical-align: middle;
}

/* Reshuffle checkbox */
.reshuffle-option {
  display: none;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
  font-size: 0.85rem;
  color: var(--muted);
}
.reshuffle-option.visible { display: flex; }
.reshuffle-option input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

/* --- Buttons ---------------------------------------------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-top: var(--sp-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--forest);
  box-shadow: 0 4px 16px rgba(212,160,23,0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(212,160,23,0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--white);
  color: var(--forest);
  border: 2px solid rgba(27,67,50,0.15);
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,160,23,0.04);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--terracotta); }

/* --- Results ---------------------------------------------- */
.results-section {
  display: none;
  margin-top: var(--sp-2xl);
  animation: fadeInUp 0.5s var(--ease);
}
.results-section.visible { display: block; }

/* Summary cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}
@media (min-width: 640px) { .summary-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .summary-grid { grid-template-columns: repeat(6, 1fr); } }

.summary-card {
  background: var(--white);
  border: 1px solid rgba(27,67,50,0.06);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.summary-card .card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-xs);
}
.summary-card .card-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--forest);
}
.summary-card .card-value.highlight { color: var(--gold); }

/* Schedule table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27,67,50,0.08);
  box-shadow: var(--shadow-sm);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 700px;
}
.schedule-table thead {
  background: var(--forest);
  color: var(--white);
}
.schedule-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.schedule-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(27,67,50,0.06);
  white-space: nowrap;
}
.schedule-table tbody tr { transition: background var(--duration) var(--ease); }
.schedule-table tbody tr:hover { background: rgba(212,160,23,0.06); }
.schedule-table tbody tr.current-recipient {
  background: var(--success-bg);
  font-weight: 600;
}
.schedule-table tbody tr.current-recipient td:nth-child(4) {
  color: var(--success);
}
/* Sticky first column on mobile */
.schedule-table th:first-child,
.schedule-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}
.schedule-table th:first-child { background: var(--forest); }
.schedule-table td:first-child { background: inherit; }
.schedule-table tbody tr:nth-child(even) td:first-child { background: rgba(251,247,240,0.98); }
.schedule-table tbody tr.current-recipient td:first-child { background: var(--success-bg); }

/* Action buttons below table */
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
}

/* --- How It Works ----------------------------------------- */
.how-it-works {
  background: var(--forest);
  color: var(--white);
  padding: var(--sp-3xl) 0;
  text-align: center;
}
.how-it-works h2 { color: var(--white); margin-top: 0; }
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  margin-top: var(--sp-xl);
}
@media (min-width: 640px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(212,160,23,0.15);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}
.step-item h3 { color: var(--white); font-size: 1.1rem; margin: 0; }
.step-item p { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin: 0; max-width: 280px; }
.step-arrow {
  display: none;
  color: var(--gold);
  font-size: 1.5rem;
  align-self: center;
}
@media (min-width: 640px) {
  .steps-grid { grid-template-columns: 1fr auto 1fr auto 1fr; }
  .step-arrow { display: flex; }
}

/* --- Ad Slots --------------------------------------------- */
.ad-slot {
  min-height: 90px;
  margin: var(--sp-xl) auto;
  text-align: center;
  max-width: 728px;
}

/* --- Article ---------------------------------------------- */
.article-section {
  padding: var(--sp-3xl) 0;
}
.article-content {
  max-width: 780px;
  margin: 0 auto;
}
.article-content h2 {
  position: relative;
  padding-bottom: var(--sp-sm);
}
.article-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.article-content p { color: var(--dark); }
.article-content ul, .article-content ol {
  margin: var(--sp-md) 0 var(--sp-lg) var(--sp-xl);
}
.article-content li { margin-bottom: var(--sp-sm); }
.article-content strong { color: var(--forest); }

/* Glossary box */
.glossary-box {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  margin: var(--sp-xl) 0;
}
.glossary-box h3 { color: var(--gold-light); margin-top: 0; }
.glossary-list { list-style: none; padding: 0; margin: 0; }
.glossary-list li {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 0;
}
.glossary-list li:last-child { border-bottom: none; }
.glossary-term {
  font-weight: 700;
  color: var(--gold-light);
  min-width: 110px;
  flex-shrink: 0;
}
.glossary-def { color: rgba(255,255,255,0.85); }

/* --- FAQ -------------------------------------------------- */
.faq-section {
  padding: var(--sp-3xl) 0;
  background: var(--cream-dark);
}
.faq-section h2 { text-align: center; margin-top: 0; }
.faq-list {
  max-width: 780px;
  margin: var(--sp-xl) auto 0;
}
.faq-item {
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-md);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-question {
  width: 100%;
  padding: var(--sp-lg);
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--forest);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  transition: background var(--duration) var(--ease);
}
.faq-question:hover { background: rgba(212,160,23,0.04); }
.faq-question .faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(27,67,50,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--duration) var(--ease);
  color: var(--gold);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), padding 0.3s var(--ease);
}
.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 0 var(--sp-lg) var(--sp-lg);
}
.faq-answer p { color: var(--muted); font-size: 0.95rem; margin-bottom: var(--sp-sm); }
.faq-answer p:last-child { margin-bottom: 0; }

/* --- Related Tools ---------------------------------------- */
.related-tools {
  padding: var(--sp-3xl) 0;
}
.related-tools h2 { text-align: center; margin-top: 0; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  max-width: 960px;
  margin: var(--sp-xl) auto 0;
}
@media (min-width: 640px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-lg);
  border: 2px solid rgba(27,67,50,0.08);
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--white);
  transition: all var(--duration) var(--ease);
}
.tool-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.tool-card .tool-icon { font-size: 1.8rem; }
.tool-card .tool-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--forest);
}
.tool-card .badge-coming-soon {
  font-size: 0.65rem;
  background: var(--cream-dark);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--forest);
  color: rgba(255,255,255,0.7);
  padding: var(--sp-xl) 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-lg);
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-sm) var(--sp-lg);
}
.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  transition: color var(--duration) var(--ease);
}
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: 0.8rem; }

/* --- Animations ------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.animate-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Toast / clipboard notification */
.toast {
  position: fixed;
  bottom: var(--sp-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--forest);
  color: var(--white);
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s var(--ease);
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Print ------------------------------------------------ */
@media print {
  body { background: white; color: black; font-size: 11pt; }

  .site-header, .hero, .btn-row, .table-actions,
  .how-it-works, .ad-slot, .faq-section, .related-tools,
  .site-footer, .names-toggle, .reshuffle-option,
  .form-error, .skip-link, .hero-cta, .toast { display: none !important; }

  .calculator-card {
    background: white;
    backdrop-filter: none;
    border: 1px solid #ccc;
    box-shadow: none;
    padding: 12pt;
    page-break-inside: avoid;
  }
  /* Hide the form inputs */
  .form-grid { display: none !important; }

  .results-section { display: block !important; margin-top: 0; animation: none; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-card { border: 1px solid #ddd; box-shadow: none; }

  .table-wrapper { border: 1px solid #ccc; overflow: visible; }
  .schedule-table { min-width: unset; font-size: 9pt; }
  .schedule-table thead { background: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .schedule-table tbody tr.current-recipient { background: #e8f5e9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .article-section { display: none !important; }

  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12pt;
    margin-bottom: 12pt;
    border-bottom: 2px solid #333;
  }
  .print-date { font-size: 9pt; color: #666; }
}
.print-header { display: none; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 639px) {
  .container { padding: 0 var(--sp-md); }
  .section { padding: var(--sp-xl) 0; }
  .hero { padding: var(--sp-xl) 0; }
  .calculator-card { padding: var(--sp-md); }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
  .table-actions { flex-direction: column; }
  .table-actions .btn { width: 100%; }
  .header-nav { display: none; }
}
