/* ==========================================================================
   Residual CSS – Styles that can't be expressed as Tailwind utilities
   (JS-toggled states, keyframes, print, reduced-motion)
   ========================================================================== */

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

/* ---------- Keyframes ---------- */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- JS-toggled states ---------- */

/* Form steps: hidden by default, shown when JS adds .form-step-active */
.form-step {
  display: none;
}
.form-step-active {
  display: block;
  animation: fadeInUp 0.35s ease;
}

/* Radio card selected state (JS adds .selected to .radio-card) */
.radio-card.selected .radio-card-content {
  border-color: var(--pcolor);
  background: rgba(26, 82, 118, 0.03);
  box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

/* Validation error highlight (JS toggles .field-error-highlight) */
.field-error-highlight {
  animation: fadeInUp 0.35s ease;
}
.field-error-highlight label {
  color: #e74c3c;
}
.field-error-highlight .form-input,
.field-error-highlight .form-textarea {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}
.field-error-highlight .radio-card-content {
  border-color: #e74c3c;
}

/* FAQ accordion (JS toggles .active on .faq-item) */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.faq-answer > * {
  overflow: hidden;
}
.faq-item.active .faq-question i,
.faq-item.active .faq-question .faq-chevron {
  transform: rotate(180deg);
}
.faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

/* Checklist completed state (JS toggles .completed on .checklist-item) */
.checklist-item.completed span {
  text-decoration: line-through;
  color: #9ca3af;
}

/* ---------- Blog: styled lists inside prose ---------- */

#blog-content ol {
  list-style: none !important;
  counter-reset: blog-counter;
  padding-left: 0 !important;
}

#blog-content > ol > li {
  counter-increment: blog-counter;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-left: 0 !important;
  margin-bottom: 1.25rem !important;
}

#blog-content > ol > li::before {
  content: counter(blog-counter) !important;
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ccolor);
  line-height: 1;
  min-width: 1.75rem;
  text-align: right;
}

/* Statistics articles: scoped overrides for the pink-badge source register
   (kills the green counter ::before and the wide li margins inherited above) */
#blog-content > ol.source-register > li {
  display: block !important;
  margin-bottom: 0 !important;
  padding-left: 0 !important;
  gap: 0 !important;
  counter-increment: none !important;
}
#blog-content > ol.source-register > li::before {
  content: none !important;
}

#blog-content > ul > li {
  position: relative;
  padding-left: 1.75rem !important;
  list-style: none !important;
}

#blog-content > ul > li::before {
  content: "" !important;
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ccolor) !important;
}

#blog-content > ul > li::marker {
  content: none !important;
  color: transparent !important;
}

/* ---------- Blog: CTA box embedded in article content ---------- */

.blog-cta-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #bbf7d0;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
  margin: 2.5rem 0;
  text-align: center;
}

.blog-cta-box .blog-cta-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.blog-cta-box .blog-cta-text {
  font-size: 0.95rem;
  color: #4b5563;
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
}

.blog-cta-box .blog-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--ccolor);
  color: #fff;
  font-weight: 700;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.blog-cta-box .blog-cta-btn:hover {
  background: var(--ccolordark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Blog: Testament vorlage document block */

.vorlage-box {
  position: relative;
  background: #fafaf9 !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 0.5rem !important;
  padding: 0 !important;
  margin: 1.75rem 0 !important;
  overflow: hidden;
}

.vorlage-box .vorlage-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f5f5f4;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem !important;
  font-weight: 600;
  color: #a3a3a3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 !important;
}

.vorlage-box .vorlage-body {
  padding: 1.25rem 1.25rem 1rem;
  font-size: 0.9rem !important;
  line-height: 1.75 !important;
  color: #374151 !important;
}

.vorlage-box .vorlage-body p {
  margin-bottom: 0.6rem !important;
}

.vorlage-box .vorlage-body p:last-child {
  margin-bottom: 0 !important;
}

.vorlage-box .vorlage-title {
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-align: center;
  margin-bottom: 1rem !important;
  color: #111827 !important;
}

.vorlage-box .vorlage-placeholder {
  color: #6b7280 !important;
  font-style: italic;
  background: #f5f5f4;
  padding: 0.05em 0.25em;
  border-radius: 3px;
  border-bottom: 1px dashed #d4d4d4;
}

.vorlage-box .vorlage-body ul {
  padding-left: 0 !important;
  list-style: none !important;
}

.vorlage-box .vorlage-body li {
  padding-left: 0 !important;
}

.vorlage-box .vorlage-body li::before {
  content: none !important;
}

/* Blog: styled tables */

#blog-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

#blog-content thead {
  background: #f9fafb;
}

#blog-content th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e5e7eb;
}

#blog-content td {
  padding: 0.75rem 1rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

#blog-content tbody tr:last-child td {
  border-bottom: none;
}

#blog-content tbody tr:hover {
  background: #f9fafb;
}

/* Blog: info/tip box */

.blog-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.blog-info-box strong {
  color: #1e40af;
}

/* Blog: warning box */

.blog-warning-box {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.blog-warning-box strong {
  color: #92400e;
}

/* ---------- Print ---------- */

@media print {
  nav,
  footer,
  .exit-intent-popup,
  #exit-intent-popup,
  #loading-overlay,
  .download-buttons,
  button,
  #checklist-section,
  #handwriting-guide,
  #nachlassgericht-info {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  #will-text {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* ---------- Reduced motion ---------- */

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