:root {
  --madgest-primary: #0b5ea8;
  --madgest-primary-dark: #08457b;
  --madgest-primary-light: #e7f0fb;
}

.btn:not(.btn-link):not(.btn-icon-only) {
  border-radius: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.35rem;
  box-shadow: 0 8px 18px rgba(8, 69, 123, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.btn:not(.btn-link):not(.btn-icon-only):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(8, 69, 123, 0.22);
}

.btn:not(.btn-link):not(.btn-icon-only):active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(8, 69, 123, 0.2);
}

.btn.btn-sm:not(.btn-link):not(.btn-icon-only) {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  border-radius: 0.6rem;
}

.btn.btn-lg:not(.btn-link):not(.btn-icon-only) {
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
  border-radius: 0.8rem;
}

.btn-primary,
.btn.btn-primary,
.btn.bg-primary {
  background-color: var(--madgest-primary);
  border-color: var(--madgest-primary);
  color: #fff;
}

.btn-primary:hover,
.btn.btn-primary:hover,
.btn.bg-primary:hover {
  background-color: var(--madgest-primary-dark);
  border-color: var(--madgest-primary-dark);
  color: #fff;
}

.btn-primary:focus-visible,
.btn.btn-primary:focus-visible,
.btn.bg-primary:focus-visible,
.btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(11, 94, 168, 0.25);
  outline: 2px solid #344767;
  outline-offset: 2px;
}

.btn-outline-primary {
  border-width: 2px;
  border-color: var(--madgest-primary);
  color: var(--madgest-primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--madgest-primary);
  border-color: var(--madgest-primary);
  color: #fff;
}

.btn-round:not(.btn-link):not(.btn-icon-only) {
  border-radius: 999px;
}

.btn.btn-outline-primary.btn-round {
  background-color: #fff;
}


.landing-hero .segment-toggle {
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0;
  box-shadow: none;
}

.landing-hero .segment-toggle .btn {
  box-shadow: none;
  padding: 0.45rem 1.1rem;
}

.landing-hero .segment-toggle .btn-outline-primary {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  background-color: transparent;
}

.landing-hero .segment-toggle .btn-outline-primary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.landing-hero .segment-toggle .btn-primary {
  background-color: #fff;
  border-color: #fff;
  color: var(--madgest-primary);
}

.landing-hero .segment-toggle .btn-primary:hover {
  background-color: #f1f6fd;
  border-color: #f1f6fd;
  color: var(--madgest-primary);
}

.landing-hero h1 {
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 576px) {
  .landing-hero h1 {
    font-size: 1.9rem;
    line-height: 1.2;
    margin-top: 0 !important;
  }

  .landing-hero .lead {
    font-size: 1rem;
  }
}

/* ==========================================================================
   How It Works — 4-Step Grid Section
   ========================================================================== */

.how-section {
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, var(--gray-100, #f8fafc) 100%);
}

.how-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 94, 168, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* Header */
.how-header {
  text-align: center;
  margin-bottom: 4rem;
}

.how-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--madgest-primary-light);
  color: var(--madgest-primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.how-badge i {
  font-size: 0.7rem;
}

.how-title {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.how-title__accent {
  background: linear-gradient(135deg, var(--madgest-primary) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.how-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #475569;
  max-width: 600px;
  margin: 0 auto;
}

/* Step grid */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
  margin-bottom: 3rem;
}

/* Vertical connector line (desktop only) */
.how-grid::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: calc(100% - 100px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--madgest-primary-light) 15%,
    var(--madgest-primary) 50%,
    var(--madgest-primary-light) 85%,
    transparent 100%
  );
  display: none;
}

@media (min-width: 768px) {
  .how-grid::before { display: block; }
}

/* Individual step card */
.how-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.35s ease;
}

.how-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.04);
  border-color: transparent;
}

.how-card:hover .how-card__icon {
  transform: scale(1.08);
}

.how-card__top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.how-card__number {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--madgest-primary);
  opacity: 0.5;
  letter-spacing: 0.02em;
}

.how-card__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  flex-shrink: 0;
}

.how-card__icon--blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--madgest-primary);
}

.how-card__icon--green {
  background: linear-gradient(135deg, #f0fdf4, #d1fae5);
  color: #059669;
}

.how-card__icon--amber {
  background: linear-gradient(135deg, #fefce8, #fef08a);
  color: #b45309;
}

.how-card__icon--purple {
  background: linear-gradient(135deg, #faf5ff, #e9d5ff);
  color: #7c3aed;
}

.how-card:hover .how-card__icon--blue {
  box-shadow: 0 8px 24px rgba(11, 94, 168, 0.2);
}

.how-card:hover .how-card__icon--green {
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.2);
}

.how-card:hover .how-card__icon--amber {
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.15);
}

.how-card:hover .how-card__icon--purple {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.how-card__heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.how-card__desc {
  font-size: 0.925rem;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 0;
}

.how-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.how-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.how-card:hover .how-tag {
  border-color: var(--madgest-primary-light);
  color: var(--madgest-primary-dark);
}

/* Bottom CTA */
.how-cta {
  text-align: center;
}

.how-cta__note {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 767px) {
  .how-section {
    padding: 3.5rem 0 4.5rem;
  }

  .how-header {
    margin-bottom: 2.5rem;
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .how-card {
    padding: 1.5rem;
  }
}

#faq .faq-item {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

#faq .faq-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--madgest-primary);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

#faq .faq-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

#faq .faq-text {
  margin: 0;
  color: #4b5563;
}

@media (max-width: 576px) {
  #faq .faq-item {
    padding: 1.2rem;
  }
}

/* ==========================================================================
   WCAG 2.1 AA Accessibility — Focus indicators, contrast, skip-to-content
   ========================================================================== */

/* Focus indicators — WCAG 2.4.7
   Override outline:none/0 from Soft Design System & Bootstrap */
*:focus-visible {
  outline: 2px solid #344767 !important;
  outline-offset: 2px !important;
}

/* Ensure focus ring on form controls is visible */
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
  outline: 2px solid #344767 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 0.2rem rgba(52, 71, 103, 0.25) !important;
}

/* Navbar toggler focus */
.navbar-toggler:focus-visible {
  outline: 2px solid #344767 !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* Details/summary (FAQ accordion) focus */
details > summary:focus-visible {
  outline: 2px solid #344767 !important;
  outline-offset: 2px !important;
}

/* Skip-to-content link */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -999;
}

.skip-to-content:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 10px 20px;
  background: #344767;
  color: #fff;
  z-index: 99999;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Color contrast fixes — WCAG 1.4.3 (4.5:1 for normal text, 3:1 for large)
   text-secondary in Soft Design System is #8392ab — contrast ratio vs white ~3.5:1 (FAIL)
   Override to #566573 which gives ~5.3:1 ratio */
.text-secondary {
  color: #566573 !important;
}

/* text-muted override: original #6c757d has ~4.6:1 which passes,
   but .small.text-muted can be below threshold.
   Use #566573 for consistent AA compliance */
.text-muted {
  color: #566573 !important;
}

/* Screen reader only utility — visually hidden but accessible */
.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;
}

/* Modal btn-close — theme sets fill to white, invisible on white header */
.modal-header .btn-close {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23344767' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e");
  opacity: 0.7;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

/* Modal focus trap — prevent interaction with background when modal is open */
.modal-backdrop {
  pointer-events: auto;
}

/* ==========================================================================
   Visual Polish — Scroll Reveal Animations (Sprint Change #7)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for grouped elements */
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }

/* WCAG 2.1 — Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .reveal.d1,
  .reveal.d2,
  .reveal.d3,
  .reveal.d4 {
    transition-delay: 0s;
  }
}

/* ==========================================================================
   Visual Polish — Card Hover Effects (Sprint Change #8)
   ========================================================================== */

.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Visual Polish — Dark Problem Section (Sprint Change #9)
   ========================================================================== */

#probleme {
  background-color: #0f1a14;
}

#probleme h2 {
  color: #fff;
}

#probleme .lead,
#probleme p {
  color: rgba(255, 255, 255, 0.85);
}

#probleme .section-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4ade80;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#probleme .card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

#probleme .card:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

#probleme .card .card-body p {
  color: rgba(255, 255, 255, 0.7);
}

#probleme .card .card-body .h5,
#probleme .card .card-body h3 {
  color: #fff;
}

#probleme .card .card-body i {
  color: #4ade80 !important;
}

/* ==========================================================================
   Visual Polish — Instrument Serif Typography (Sprint Change #10)
   ========================================================================== */

.section-heading-serif,
.index-page section h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
}

.index-page section h2 em,
.section-heading-serif em {
  font-style: italic;
}

/* ==========================================================================
   Visual Polish — Image Placeholders
   ========================================================================== */

.img-placeholder {
  background: #e9ecef;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  color: #6c757d;
  font-size: 0.85rem;
  border: 2px dashed #ced4da;
  margin-bottom: 1rem;
}

.img-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}
