/* ============================================
   Chalets Ardennen — Design Engineering
   Custom Properties, Utilities, Animations
   ============================================ */

:root {
  /* Colors */
  --color-primary: #16A34A;
  --color-primary-hover: #15803D;
  --color-primary-light: #F0FDF4;
  --color-secondary: #475569;
  --color-bg: #FFFFFF;
  --color-surface: #F8FAFC;
  --color-surface-alt: #F1F5F9;
  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-focus: #16A34A;
  --color-success: #16A34A;
  --color-warning: #EAB308;
  --color-error: #DC2626;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Motion */
  --duration-micro: 200ms;
  --duration-section: 300ms;
  --duration-hover: 150ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Base
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography Utilities
   ============================================ */
.text-display {
  font-size: 56px;
  line-height: 64px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.text-h1 {
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-h2 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
}

.text-h3 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

.text-h4 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}

.text-body-lg {
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
}

.text-body {
  font-size: 15px;
  line-height: 24px;
  font-weight: 400;
}

.text-body-sm {
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

.text-caption {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.text-overline {
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================
   Focus Rings
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--duration-hover) ease-out, transform var(--duration-hover) ease-out, box-shadow var(--duration-hover) ease-out;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--duration-hover) ease-out, border-color var(--duration-hover) ease-out, box-shadow var(--duration-hover) ease-out;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* ============================================
   Chip / Badge
   ============================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.chip-green {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--duration-hover) ease-out, box-shadow var(--duration-hover) ease-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-static {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ============================================
   Nav
   ============================================ */
.nav-blur {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--color-border);
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  transition: color var(--duration-hover) ease-out, background var(--duration-hover) ease-out;
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ============================================
   Form Inputs
   ============================================ */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-hover) ease-out, box-shadow var(--duration-hover) ease-out;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* ============================================
   Image Placeholder
   ============================================ */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.img-placeholder-green {
  background: linear-gradient(135deg, #BBF7D0 0%, #86EFAC 100%);
  color: var(--color-primary-hover);
}

.img-placeholder-dark {
  background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
  color: #94A3B8;
}

/* ============================================
   Scroll Animations
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-section) ease-out, transform var(--duration-section) ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 50ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 100ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 150ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 200ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 250ms; }
.stagger-children .animate-on-scroll:nth-child(7) { transition-delay: 300ms; }
.stagger-children .animate-on-scroll:nth-child(8) { transition-delay: 350ms; }
.stagger-children .animate-on-scroll:nth-child(9) { transition-delay: 400ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Mobile Nav Drawer
   ============================================ */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-section) ease-out;
}

.nav-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--color-bg);
  z-index: 100;
  transform: translateX(100%);
  transition: transform var(--duration-section) var(--ease-out);
  padding: 24px;
  box-shadow: var(--shadow-xl);
}

.nav-drawer.open {
  transform: translateX(0);
}

/* ============================================
   Accordion (details/summary)
   ============================================ */
details.accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

details.accordion + details.accordion {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

details.accordion:first-child {
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

details.accordion:last-child {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

details.accordion summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  transition: background var(--duration-hover) ease-out;
}

details.accordion summary:hover {
  background: var(--color-surface);
}

details.accordion summary::-webkit-details-marker {
  display: none;
}

details.accordion summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text-muted);
  transition: transform var(--duration-micro) ease-out;
}

details.accordion[open] summary::after {
  content: '−';
}

details.accordion .accordion-body {
  padding: 0 20px 16px;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 24px;
}

/* ============================================
   Tab Toggle
   ============================================ */
.tab-toggle {
  display: inline-flex;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  padding: 8px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-micro) ease-out, color var(--duration-micro) ease-out, box-shadow var(--duration-micro) ease-out;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Pricing Table
   ============================================ */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.pricing-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
}

.pricing-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody tr:hover {
  background: var(--color-surface);
}

.pricing-table .row-highlight {
  background: var(--color-primary-light);
}

.pricing-table .row-highlight:hover {
  background: #DCFCE7;
}

.pricing-table .price-cell {
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}

/* ============================================
   Responsive Helpers
   ============================================ */
@media (max-width: 768px) {
  .text-display {
    font-size: 36px;
    line-height: 42px;
  }
  .text-h1 {
    font-size: 30px;
    line-height: 36px;
  }
  .text-h2 {
    font-size: 24px;
    line-height: 30px;
  }
}
