/* ==========================================================================
   TEENS DAY '26 — SPIRITUAL BOUQUET ROSARY COUNTER
   Bespoke, sacred, contemplative aesthetic: Deep stone, beeswax gold & bone white
   ========================================================================== */

:root {
  /* Sanctuary Color Palette */
  --bg-deep: #121314;
  --bg-stone: #17181a;
  --bg-stone-elevated: #1e2022;
  --bg-stone-card: #151618;
  
  /* Candles & Beeswax Metals */
  --gold-candlelight: #d4af37;
  --gold-beeswax: #c5a059;
  --gold-warm-amber: #e8be5b;
  --gold-deep-brass: #8f6f22;
  --gold-soft-glow: rgba(212, 175, 55, 0.18);
  --gold-ring-glow: rgba(212, 175, 55, 0.45);
  
  /* Bone White & Aged Linen Typography */
  --text-bone: #eae6df;
  --text-parchment: #d6d0c4;
  --text-muted: #9c968c;
  --text-subtle: #635f58;
  --text-dim: #44413c;

  /* Natural Ash & Stone Borders */
  --border-ash: #262422;
  --border-ash-soft: #33302c;
  --border-ash-lit: #4a443c;
  --border-gold-trim: rgba(212, 175, 55, 0.28);

  /* Status Colors */
  --danger-crimson: #a63a3a;
  --danger-crimson-hover: #c44747;
  --success-olive: #6b8e5a;

  /* Typography Stacks */
  --font-serif-monument: 'Cinzel', serif;
  --font-serif-devotional: 'Cormorant Garamond', Georgia, serif;
  --font-mono-numbers: 'Cinzel', 'JetBrains Mono', 'Courier New', monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background-color: var(--bg-deep);
  color: var(--text-bone);
  font-family: var(--font-serif-devotional);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(197, 160, 89, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Subtle architectural chapel veil texture overlay */
.chapel-veil {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 180px, rgba(212, 175, 55, 0.04) 0%, transparent 450px);
  z-index: 0;
}

/* Screen reader utility */
.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;
}

/* Page Frame */
.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.25rem 1.5rem 1.75rem;
}

/* ==========================================================================
   HEADER: Dignified Editorial Monogram & Titles
   ========================================================================== */

.sacred-header {
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sacred-cross {
  width: 28px;
  height: 38px;
  color: var(--gold-candlelight);
  margin-bottom: 1.1rem;
  opacity: 0.88;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.35));
}

.sacred-cross svg {
  width: 100%;
  height: 100%;
}

.header-eyebrow {
  font-family: var(--font-serif-monument);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-beeswax);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.header-title {
  font-family: var(--font-serif-monument);
  font-size: clamp(2.1rem, 6.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-bone);
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 0.7rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.header-intention {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif-devotional);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-parchment);
}

.intention-divider {
  color: var(--gold-candlelight);
  font-size: 0.75rem;
  opacity: 0.7;
}

.intention-goal {
  color: var(--gold-candlelight);
  font-weight: 500;
}

/* ==========================================================================
   SANCTUARY CORE: Central Counter, Progress, Decade chaplet
   ========================================================================== */

.sanctuary-core {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
  width: 100%;
}

/* Live Counter Altar */
.counter-altar {
  text-align: center;
  position: relative;
  width: 100%;
  padding: 0.5rem 0;
}

.digits-wrapper {
  position: relative;
  display: inline-block;
}

.counter-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.counter-digits {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono-numbers);
  font-size: clamp(3.6rem, 13vw, 5.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
  color: var(--text-bone);
  line-height: 1;
  text-shadow: 
    0 0 24px rgba(212, 175, 55, 0.22),
    0 4px 16px rgba(0, 0, 0, 0.9);
  transition: transform 120ms ease-out, color 200ms ease;
  user-select: none;
}

.counter-digits.bump {
  transform: scale(1.035);
  color: #fff9e6;
  text-shadow: 0 0 32px rgba(212, 175, 55, 0.6);
}

.counter-unit {
  font-family: var(--font-serif-monument);
  font-size: 0.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.9rem;
}

/* ==========================================================================
   GOAL PROGRESS TRACKER
   ========================================================================== */

.progress-section {
  width: 100%;
  background: var(--bg-stone-card);
  border: 1px solid var(--border-ash);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.progress-ratio {
  font-family: var(--font-mono-numbers);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text-bone);
}

.progress-ratio strong {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold-candlelight);
}

.progress-ratio .dim {
  color: var(--text-dim);
  margin: 0 0.15rem;
}

.progress-percent {
  font-family: var(--font-mono-numbers);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-warm-amber);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #0d0e0f;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8f6f22 0%, var(--gold-beeswax) 50%, var(--gold-candlelight) 100%);
  border-radius: 999px;
  position: relative;
  width: 0%;
  min-width: 0%;
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
}

.progress-candle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fffbe8;
  box-shadow: 0 0 8px 3px rgba(255, 240, 180, 0.9);
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  font-family: var(--font-serif-devotional);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
}

/* ==========================================================================
   DECADE CHAPLET: Visual 10-Bead Ring
   ========================================================================== */

.decade-chaplet {
  width: 100%;
  background: var(--bg-stone-card);
  border: 1px solid var(--border-ash);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.decade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.decade-title {
  font-family: var(--font-serif-monument);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-parchment);
}

.decade-step {
  font-family: var(--font-mono-numbers);
  font-size: 0.85rem;
  color: var(--gold-beeswax);
  font-weight: 500;
}

/* 10-Bead Physical Representation */
.decade-ring {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
  align-items: center;
  justify-items: center;
  padding: 0.75rem 0.25rem;
  position: relative;
}

/* Visual Rosary cord threading behind beads */
.decade-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #23211e;
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 2px;
}

.bead {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
}

.bead-core {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a3733 0%, #201e1c 70%, #151413 100%);
  border: 1px solid #33302c;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  transition: all var(--transition-smooth);
}

/* Lit Bead: Candlelit Olive-Wood / Beeswax Tone */
.bead.completed .bead-core {
  background: radial-gradient(circle at 35% 30%, #f7dc88 0%, var(--gold-candlelight) 40%, #8c6c1f 100%);
  border-color: #eed686;
  box-shadow: 
    0 0 12px var(--gold-ring-glow),
    0 2px 6px rgba(0, 0, 0, 0.8),
    inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* Currently Active / Just Clicked Bead */
.bead.active .bead-core {
  transform: scale(1.15);
  box-shadow: 
    0 0 16px rgba(255, 220, 110, 0.85),
    0 2px 8px rgba(0, 0, 0, 0.9),
    inset 0 1px 3px #ffffff;
}

.decade-subtext {
  font-family: var(--font-serif-devotional);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.95rem;
}

/* ==========================================================================
   DEDICATED PRAYER SUBMISSION UNIT: Tactile Batch Input & Devotional Chips
   ========================================================================== */

.action-sanctuary {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.25rem;
}

.prayer-submission-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.offering-card {
  width: 100%;
  background: var(--bg-stone-card);
  border: 1px solid var(--border-ash);
  border-radius: 14px;
  padding: 1.35rem 1.45rem;
  box-shadow: 
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition-fast);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.input-label {
  font-family: var(--font-serif-monument);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-parchment);
}

.input-hint {
  font-family: var(--font-serif-devotional);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
}

.number-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-prefix-icon {
  position: absolute;
  left: 1.15rem;
  color: var(--gold-beeswax);
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.5;
  font-family: var(--font-serif-devotional);
}

.prayer-number-input {
  width: 100%;
  background: #0b0c0d;
  border: 1px solid var(--border-ash-soft);
  border-radius: 10px;
  padding: 0.85rem 2.8rem 0.85rem 2.6rem;
  font-family: var(--font-mono-numbers);
  font-size: 1.55rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff9e6;
  text-align: center;
  letter-spacing: 0.04em;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform 80ms ease;
}

/* Hide default numeric spin arrows */
.prayer-number-input::-webkit-outer-spin-button,
.prayer-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.prayer-number-input[type=number] {
  -moz-appearance: textfield;
}

.prayer-number-input::placeholder {
  font-family: var(--font-serif-devotional);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: normal;
}

.prayer-number-input:focus {
  border-color: var(--gold-candlelight);
  box-shadow: 
    0 0 0 1px var(--gold-candlelight),
    0 0 18px rgba(212, 175, 55, 0.22),
    inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.prayer-number-input.input-invalid {
  border-color: var(--danger-crimson);
  box-shadow: 0 0 0 1px var(--danger-crimson), 0 0 12px rgba(166, 58, 58, 0.35);
  animation: inputShake 300ms ease-in-out;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.clear-input-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.clear-input-btn:hover {
  color: var(--text-bone);
}

.clear-input-btn svg {
  width: 15px;
  height: 15px;
}

.clear-input-btn.hidden {
  display: none;
}

/* Devotional Quick Chips */
.chips-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-top: 1rem;
}

.quick-chip {
  background: #191a1c;
  border: 1px solid var(--border-ash-soft);
  border-radius: 8px;
  padding: 0.55rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.quick-chip:hover {
  background: #222427;
  border-color: var(--gold-beeswax);
  transform: translateY(-1px);
}

.quick-chip:active {
  transform: translateY(1px);
  background: #141517;
  border-color: var(--gold-candlelight);
}

.chip-num {
  font-family: var(--font-mono-numbers);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-warm-amber);
  letter-spacing: 0.02em;
}

.chip-caption {
  font-family: var(--font-serif-devotional);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.1;
  text-align: center;
}

/* Primary Devotional Action Button */
.btn-prayer {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 68px;
  padding: 0 2rem;
  border: 1px solid var(--gold-deep-brass);
  border-radius: 999px;
  background: linear-gradient(180deg, #2b251a 0%, #1c1811 100%);
  color: var(--gold-warm-amber);
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  overflow: hidden;
  box-shadow: 
    0 4px 0 #0d0b07,
    0 12px 28px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(245, 215, 120, 0.25);
  transition: transform 90ms ease, box-shadow 90ms ease, background 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-prayer:hover {
  background: linear-gradient(180deg, #332b1d 0%, #221c13 100%);
  border-color: var(--gold-candlelight);
  color: #fff2c7;
  box-shadow: 
    0 4px 0 #0d0b07,
    0 14px 32px rgba(212, 175, 55, 0.15),
    inset 0 1px 2px rgba(255, 235, 150, 0.35);
}

.btn-prayer:active {
  transform: translateY(3px);
  box-shadow: 
    0 1px 0 #0d0b07,
    0 4px 12px rgba(0, 0, 0, 0.8),
    inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.prayer-icon {
  width: 24px;
  height: 24px;
  color: var(--gold-candlelight);
  flex-shrink: 0;
}

.prayer-icon svg {
  width: 100%;
  height: 100%;
}

.prayer-label {
  font-family: var(--font-serif-monument);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 999px 999px 0 0;
}

.keyboard-cue {
  font-family: var(--font-serif-devotional);
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-style: italic;
}

kbd {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  background: #1e2022;
  border: 1px solid var(--border-ash-soft);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   DEVOTIONAL REFLECTION CARD
   ========================================================================== */

.devotional-reflection {
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-ash);
  margin-top: 0.5rem;
}

.reflection-quote blockquote {
  font-family: var(--font-serif-devotional);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-parchment);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.reflection-quote cite {
  font-family: var(--font-serif-monument);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-beeswax);
  font-style: normal;
}

/* ==========================================================================
   DISCREET FOOTER
   ========================================================================== */

.sacred-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-ash);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-center {
  text-align: center;
  flex: 1;
}

.byline-text {
  font-family: var(--font-serif-devotional);
  font-size: 0.86rem;
  color: var(--text-subtle);
}

.byline-text strong {
  color: var(--text-parchment);
  font-weight: 500;
}

/* Audio control toggle button */
.footer-control-btn {
  background: transparent;
  border: 1px solid var(--border-ash);
  color: var(--text-muted);
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.footer-control-btn:hover {
  border-color: var(--border-ash-lit);
  color: var(--text-bone);
  background: #18191b;
}

.control-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-icon svg {
  width: 100%;
  height: 100%;
}

/* Sync indicator */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success-olive);
  box-shadow: 0 0 6px rgba(107, 142, 90, 0.6);
}

.sync-indicator.syncing .sync-dot {
  background-color: var(--gold-candlelight);
  box-shadow: 0 0 6px var(--gold-candlelight);
  animation: pulseSync 1s infinite alternate;
}

.sync-indicator.offline .sync-dot {
  background-color: var(--danger-crimson);
  box-shadow: 0 0 6px var(--danger-crimson);
}

@keyframes pulseSync {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Admin Trigger Lock */
.admin-trigger-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-subtle);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-trigger-btn:hover {
  color: var(--gold-beeswax);
  border-color: var(--border-ash);
  background: #18191b;
}

.admin-trigger-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   ADMIN RESET MODAL DIALOG
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 11, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-stone-card);
  border: 1px solid var(--border-ash-lit);
  border-radius: 14px;
  box-shadow: 
    0 24px 50px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(212, 175, 55, 0.1);
  overflow: hidden;
  animation: modalIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    transform: translateY(12px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 1.4rem 1.5rem 1rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-ash);
}

.modal-badge-icon {
  width: 22px;
  height: 22px;
  color: var(--gold-beeswax);
}

.modal-badge-icon svg {
  width: 100%;
  height: 100%;
}

.modal-title {
  flex: 1;
  font-family: var(--font-serif-monument);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-bone);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-bone);
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-description {
  font-family: var(--font-serif-devotional);
  font-size: 0.98rem;
  color: var(--text-parchment);
  line-height: 1.5;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-family: var(--font-serif-monument);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-container {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  background: #0e0f10;
  border: 1px solid var(--border-ash-soft);
  color: var(--text-bone);
  border-radius: 8px;
  padding: 0.75rem 2.8rem 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--gold-candlelight);
  box-shadow: 0 0 0 1px var(--gold-candlelight);
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: var(--text-parchment);
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.error-feedback {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #ea6b6b;
  margin-top: 0.35rem;
}

.error-feedback.hidden,
.success-feedback.hidden {
  display: none;
}

.success-feedback {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #7ece6e;
  margin-top: 0.35rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-ash-soft);
  color: var(--text-parchment);
  padding: 0.65rem 1.15rem;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-secondary:hover {
  background: #1f2022;
}

.btn-danger {
  background: var(--danger-crimson);
  border: 1px solid transparent;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition-fast);
}

.btn-danger:hover {
  background: var(--danger-crimson-hover);
}

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

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-spinner.hidden {
  display: none;
}

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

/* ==========================================================================
   PARTICLES & TOAST NOTIFICATIONS
   ========================================================================== */

.particles-anchor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

.floating-blessing {
  position: absolute;
  font-family: var(--font-serif-monument);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold-candlelight);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatUpAndFade 1000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes floatUpAndFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.85);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -18px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -64px) scale(0.95);
  }
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-message {
  background: #1b1c1e;
  border: 1px solid var(--border-ash-lit);
  color: var(--text-bone);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-serif-devotional);
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  animation: toastIn 200ms ease-out forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE TUNING
   ========================================================================== */

@media (max-width: 580px) {
  .page-container {
    padding: 1.75rem 1rem 1.25rem;
  }

  .sacred-header {
    margin-bottom: 1.75rem;
  }

  .counter-digits {
    font-size: 4rem;
  }

  .decade-ring {
    gap: 0.25rem;
  }

  .bead {
    width: 26px;
    height: 26px;
  }

  .bead-core {
    width: 18px;
    height: 18px;
  }

  .offering-card {
    padding: 1.15rem 1rem;
  }

  .prayer-number-input {
    font-size: 1.35rem;
    padding: 0.75rem 2.2rem 0.75rem 2rem;
  }

  .chips-group {
    gap: 0.35rem;
  }

  .quick-chip {
    padding: 0.45rem 0.2rem;
  }

  .chip-num {
    font-size: 0.88rem;
  }

  .chip-caption {
    font-size: 0.65rem;
  }

  .btn-prayer {
    min-height: 64px;
  }

  .prayer-label {
    font-size: 1rem;
    letter-spacing: 0.08em;
  }

  .sacred-footer {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    justify-content: center;
  }
}
