/* ===================================
   DESIGN TOKENS
   =================================== */
:root {
  --teal-dark: #1a5c5a;
  --teal: #1a7b78;
  --teal-light: #2a9d8f;
  --bg-main: #d6e8f0;
  --bg-page: #12596b;
  --bg-card: #ffffff;
  --bg-result: #f0f8f7;
  --text-dark: #1a2e35;
  --text-mid: #4a6670;
  --text-light: #7a9aa8;
  --accent-gold: #e8c547;
  --border-light: #c8dce5;
  --shadow-sm: 0 2px 8px rgba(26, 92, 90, 0.08);
  --shadow-md: 0 4px 20px rgba(26, 92, 90, 0.12);
  --shadow-lg: 0 8px 40px rgba(26, 92, 90, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   FONT FACE — Calvino
   =================================== */
@font-face {
  font-family: 'Calvino';
  src: local('Calvino'), local('calvino');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Calvino';
  src: local('Calvino Bold'), local('calvino-bold');
  font-weight: 700;
  font-style: normal;
}

/* ===================================
   RESET & BASE
   =================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Calvino', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===================================
   HERO (sans header)
   =================================== */
.hero {
  text-align: center;
  padding: 48px 20px 32px;
  background: var(--bg-page);
}

.hero h1 {
  font-size: 1.85rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

/* ===================================
   CALCULATOR SECTION
   =================================== */
.calculator-section {
  flex: 1;
  padding: 0 16px 48px;
  margin-top: -16px;
}

.calculator-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px 32px;
  box-shadow: var(--shadow-lg);
}

/* ===================================
   STEPS
   =================================== */
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  margin-top: 8px;
}

.step:not(:first-child) {
  margin-top: 32px;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* ===================================
   FORMULA SELECTION
   =================================== */
.formula-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.formula-option {
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.formula-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--transition);
}

.formula-option:hover {
  border-color: var(--teal-light);
  box-shadow: var(--shadow-sm);
}

.formula-option.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), var(--shadow-md);
}

.formula-option.selected::before {
  background: var(--teal);
}

.formula-badge {
  display: inline-block;
  background: var(--teal-dark);
  color: #fff;
  padding: 5px 18px;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.badge-alt {
  background: var(--teal-light);
}

.formula-price {
  margin-bottom: 12px;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.price-unit {
  font-size: 0.85rem;
  color: var(--text-mid);
}

.formula-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formula-features li {
  font-size: 0.88rem;
  color: var(--text-mid);
}

/* ===================================
   FORMULA COMBINEE SPECIFICS
   =================================== */
#formula-combinee .formula-badge {
  background: var(--teal-light);
  color: #ffffff;
}

/* ===================================
   PAGES INPUT
   =================================== */
.pages-input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.pages-input-container {
  display: flex;
  align-items: center;
  background: #f4f8fa;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

.pages-input-container:focus-within {
  border-color: var(--teal);
}

.pages-btn {
  width: 44px;
  height: 48px;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--teal-dark);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: inherit;
}

.pages-btn:hover {
  background: var(--teal);
  color: #fff;
}

.pages-btn:active {
  transform: scale(0.92);
}

.pages-input {
  width: 80px;
  height: 48px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-dark);
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
}

.pages-input::-webkit-outer-spin-button,
.pages-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.pages-label {
  font-size: 1rem;
  color: var(--text-mid);
  font-weight: 500;
}

/* ===================================
   SLIDER
   =================================== */
.slider-container {
  margin-bottom: 12px;
  padding: 0 4px;
}

.pages-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-light);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  position: relative;
}

.pages-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--teal);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(26, 92, 90, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 3px solid #fff;
}

.pages-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(26, 92, 90, 0.4);
}

.pages-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.pages-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--teal);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(26, 92, 90, 0.3);
  border: 3px solid #fff;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}

.slider-labels span {
  font-size: 0.75rem;
  color: var(--text-light);
}

.info-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 28px;
  padding: 8px 16px;
  background: #f4f8fa;
  border-radius: var(--radius-sm);
  display: inline-block;
  width: 100%;
}

/* ===================================
   STUDENT TOGGLE
   =================================== */
.student-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #f4f8fa;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 28px;
  user-select: none;
}

.student-toggle:hover {
  border-color: var(--teal-light);
  background: #edf4f7;
}

.student-toggle input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 48px;
  height: 28px;
  background: var(--border-light);
  border-radius: 14px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.student-toggle input:checked~.toggle-switch {
  background: var(--teal);
}

.student-toggle input:checked~.toggle-switch::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-discount {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.02em;
}

.student-toggle input:checked~.toggle-label .toggle-discount {
  background: #2e7d32;
  color: #fff;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* ===================================
   RESULT CARD
   =================================== */
.result-card {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  color: #fff;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.result-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.result-separator {
  opacity: 0.5;
}

.result-student-badge {
  background: rgba(46, 125, 50, 0.5);
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.78rem;
  font-weight: 600;
}

.result-student-badge.hidden {
  display: none;
}

.result-details {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.result-words,
.result-price-block {
  flex: 1;
}

.result-details .label {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-details .value {
  font-size: 1.2rem;
  font-weight: 700;
}

.result-divider {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.result-total {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.result-amount {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.result-currency {
  font-size: 1.2rem;
  font-weight: 600;
}

.result-original-price {
  font-size: 0.85rem;
  opacity: 0.6;
  text-decoration: line-through;
  margin-top: 2px;
}

.result-original-price.hidden {
  display: none;
}

/* ===================================
   CTA BUTTON
   =================================== */
.btn-devis {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--bg-page);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-xl);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn-devis::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.btn-devis:hover::before {
  opacity: 1;
}

.btn-devis:active {
  transform: translateY(0);
}

.btn-devis svg {
  transition: transform var(--transition);
}

.btn-devis:hover svg {
  transform: translateX(4px);
}

/* ===================================
   DISCLAIMER
   =================================== */
.disclaimer {
  margin-top: 24px;
  padding: 18px 20px;
  background: #fef9e7;
  border: 1px solid #f0dca0;
  border-left: 4px solid #e8c547;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #5d4e37;
  line-height: 1.6;
}

.disclaimer-title {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: #8a6d3b;
}

.disclaimer p+p {
  margin-top: 8px;
}

.disclaimer strong {
  color: #6b4f2a;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* ===================================
   UTILITIES
   =================================== */
.hidden {
  display: none !important;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card.updating {
  animation: pulse 0.25s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.01);
  }

  100% {
    transform: scale(1);
  }
}

/* ===================================
   RESPONSIVE — TABLET+
   =================================== */
@media (min-width: 600px) {
  .formula-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* La Formule Combinée prend la largeur totale (en dessous) */
  #formula-combinee {
    grid-column: 1 / -1;
  }

  .calculator-card {
    padding: 36px 32px 40px;
  }

  .mobile-only {
    display: none;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}

/* ===================================
   RESPONSIVE — DESKTOP
   =================================== */
@media (min-width: 768px) {
  .hero {
    padding: 60px 20px 40px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-sub {
    font-size: 1.1rem;
  }

  .calculator-card {
    padding: 44px 48px 48px;
  }

  .step-title {
    font-size: 1.2rem;
  }

  .result-amount {
    font-size: 2.4rem;
  }
}

/* ===================================
   RESPONSIVE — LARGE DESKTOP
   =================================== */
@media (min-width: 1024px) {
  .calculator-card {
    max-width: 680px;
  }
}
