/*
 * Monument Path - Design System
 * A calm, guided intake experience for grieving families
 *
 * Design Philosophy: Reduce uncertainty, invite a calm first step
 * No animations. No novelty. Purposefully calm.
 */

/* ==========================================================================
   Fonts
   Using Libre Baskerville for display (classic, readable serif)
   System fonts for body (fast, accessible)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap');

/* ==========================================================================
   Design Tokens
   Same calm palette as ATX Monuments - consistency across the experience
   ========================================================================== */

:root {
  /* Typography */
  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font sizes - generous for older eyes and stressed readers */
  --text-xs: 0.875rem;    /* 14px */
  --text-sm: 1rem;        /* 16px */
  --text-base: 1.125rem;  /* 18px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.875rem;   /* 30px */
  --text-3xl: 2.25rem;    /* 36px */

  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Colors - Warm stone grays, Texas limestone inspired */
  --color-stone: #5c5a52;
  --color-stone-light: #8a8780;
  --color-stone-dark: #3d3c37;

  /* Background - Warm whites */
  --color-cream: #faf9f6;
  --color-cream-dark: #f0ede6;

  /* Text */
  --color-text: #2d2c29;
  --color-text-secondary: #5c5a52;
  --color-text-light: #6b6860;

  /* Accent - Subtle warmth */
  --color-accent: #8b7355;
  --color-accent-dark: #6d5a43;

  /* Functional */
  --color-border: #e0ddd6;
  --color-surface: #ffffff;
  --color-focus: #8b7355;
  --color-success: #4a7c59;
  --color-error: #a33;

  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* Layout - Narrower for focused intake flow */
  --max-width: 600px;
  --container-padding: var(--space-6);

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-cream);
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-4);
}

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

a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-stone-dark);
}

a:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-stone-dark);
  color: var(--color-cream);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.main {
  min-height: 60vh;
}

/* ==========================================================================
   Header - Minimal for intake focus
   ========================================================================== */

.header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__brand {
  text-decoration: none;
  color: var(--color-text);
}

.header__wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-stone-dark);
  line-height: 1;
}

/* ==========================================================================
   Footer - Minimal
   ========================================================================== */

.footer {
  background-color: var(--color-stone-dark);
  color: var(--color-cream);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: auto;
}

.footer__inner {
  text-align: center;
  margin-bottom: var(--space-6);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-base);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-cream);
  margin-bottom: var(--space-2);
}

.footer__tagline {
  color: var(--color-stone-light);
  font-size: var(--text-sm);
}

.footer__bottom {
  border-top: 1px solid var(--color-stone);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-stone-light);
  text-align: center;
}

.footer__legal a {
  color: var(--color-stone-light);
  text-decoration: none;
}

.footer__legal a:hover {
  color: var(--color-cream);
}

/* ==========================================================================
   Intake Flow Container
   ========================================================================== */

.intake {
  padding: var(--space-10) 0 var(--space-16);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
}

.intake__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.intake__title {
  margin-bottom: var(--space-3);
}

.intake__subtitle {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
}

/* ==========================================================================
   Intake Steps
   ========================================================================== */

.intake-step {
  display: none;
  flex-direction: column;
  min-height: 400px;
}

.intake-step--active {
  display: flex;
}

@media (min-width: 480px) {
  .intake-step {
    min-height: 420px;
  }
}

.intake-step__content {
  flex: 1;
}

.intake-step__actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.intake-step__actions--single {
  justify-content: flex-end;
}

.intake-step__actions--split {
  justify-content: space-between;
}

/* ==========================================================================
   Progress Indicator
   ========================================================================== */

.progress {
  margin-bottom: var(--space-8);
}

.progress__bar {
  height: 4px;
  background-color: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress__fill {
  height: 100%;
  background-color: var(--color-stone);
  border-radius: 2px;
  width: 0%;
}

.progress__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-label--required::after {
  content: " *";
  color: var(--color-accent);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-stone-light);
}

.form-input--error {
  border-color: var(--color-error);
}

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

.form-hint {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-top: var(--space-2);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-2);
}

/* ==========================================================================
   Radio Buttons - Large touch targets
   ========================================================================== */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio-option {
  position: relative;
}

.radio-option__input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.radio-option__label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 56px;
  font-size: var(--text-lg);
}

.radio-option__input:focus + .radio-option__label {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.radio-option__input:checked + .radio-option__label {
  border-color: var(--color-stone);
  background-color: var(--color-cream-dark);
}

.radio-option__indicator {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-stone-light);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-option__input:checked + .radio-option__label .radio-option__indicator {
  border-color: var(--color-stone-dark);
}

.radio-option__indicator::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-stone-dark);
  opacity: 0;
}

.radio-option__input:checked + .radio-option__label .radio-option__indicator::after {
  opacity: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 52px;
  min-width: 120px;
}

.btn:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--color-stone-dark);
  color: var(--color-cream);
  border-color: var(--color-stone-dark);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-stone);
  border-color: var(--color-stone);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-stone-dark);
  border-color: var(--color-border);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-cream-dark);
  border-color: var(--color-stone-light);
}

.btn--link {
  background: none;
  border: none;
  color: var(--color-accent-dark);
  text-decoration: underline;
  padding: var(--space-2);
  min-height: auto;
  min-width: auto;
}

.btn--link:hover {
  color: var(--color-stone-dark);
}

.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Confirmation Page
   ========================================================================== */

.confirmation {
  padding: var(--space-16) 0;
  text-align: center;
}

.confirmation__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  color: var(--color-success);
}

.confirmation__title {
  margin-bottom: var(--space-4);
}

.confirmation__message {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.confirmation__note {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-10);
}

.confirmation__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

@media (min-width: 480px) {
  .confirmation__actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* ==========================================================================
   Welcome/Landing Page
   ========================================================================== */

.welcome {
  padding: var(--space-16) 0;
  text-align: center;
}

.welcome__title {
  margin-bottom: var(--space-6);
}

.welcome__subtitle {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-10);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Page Content (Privacy, etc.)
   ========================================================================== */

.page-header {
  padding: var(--space-10) 0 var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.page-header__title {
  text-align: center;
}

.page-content {
  padding: var(--space-10) 0;
}

.page-content h2 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.page-content ul,
.page-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.page-content li {
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Turnstile CAPTCHA
   ========================================================================== */

.turnstile-wrapper {
  display: flex;
  justify-content: center;
  margin: var(--space-6) 0;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4);
  color: var(--color-text-secondary);
}

.loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-stone);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Hidden Attribute Support
   ========================================================================== */

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Form Error Banner
   ========================================================================== */

.form-error-banner {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  color: #991b1b;
  font-size: var(--text-sm);
}

.form-error-banner p {
  margin: 0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .header,
  .footer,
  .btn,
  .progress {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
