/* ============================================
   DESIGN SYSTEM — Inspiration Tesla
   Palette sobre, typo Inter, espaces généreux
   ============================================ */

:root {
  /* Couleurs */
  --bg: #FFFFFF;
  --bg-alt: #F4F4F4;
  --bg-dark: #171A20;
  --text: #171A20;
  --text-muted: #5C5E62;
  --text-light: #A6A8AB;
  --border: #E5E5E5;
  --border-strong: #171A20;
  --accent: #E31937;
  --accent-hover: #C20E2A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Typo */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* CONTAINER */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* TYPO */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 48px; line-height: 1.1; }
h2 { font-size: 32px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }
@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.header-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.header-nav {
  display: flex;
  gap: 32px;
}
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: opacity var(--transition);
}
.header-nav a:hover { opacity: 0.6; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-alt);
  padding: 32px 0;
  margin-top: 80px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 120px 0 80px;
  text-align: center;
}
.hero-title {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .hero { padding: 60px 0 40px; }
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
}

/* ============================================
   STEPS (1 / 2 / 3)
   ============================================ */
.steps { padding: 0 0 80px; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
}
.step { display: flex; align-items: center; gap: 16px; }
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}
.step-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; gap: 16px; padding: 32px 24px; }
}

/* ============================================
   CATEGORY SECTIONS
   ============================================ */
.category-section { padding: 40px 0 24px; text-align: center; }
.section-title { font-size: 32px; }

.category { padding: 48px 0; }
.category-header { margin-bottom: 32px; }
.category-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* CARDS GRID */
.cards-grid {
  display: grid;
  gap: 24px;
}
.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  .cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cards-grid-2, .cards-grid-3 { grid-template-columns: 1fr; }
}

/* CARD */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  display: block;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-alt);
  background-size: cover;
  background-position: center;
}
.card-body { padding: 20px 24px; }
.card-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 32px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #000; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}
.btn-secondary:hover { background: var(--text); color: var(--bg); }
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-full { width: 100%; }

/* ============================================
   FORMS / INPUTS
   ============================================ */
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 15px;
  transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--text); }
.label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 48px 40px;
  box-shadow: var(--shadow-md);
}
.login-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 32px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error {
  color: var(--accent);
  font-size: 13px;
  text-align: center;
}

/* ============================================
   CALCULATOR PAGES (à enrichir)
   ============================================ */
.calc-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--text);
  transition: width 400ms ease;
}
.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* RADIO IMAGE CARDS (composant clé du calculateur) */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.option-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  overflow: hidden;
}
.option-card:hover { border-color: var(--text-muted); }
.option-card.selected {
  border-color: var(--text);
  border-width: 2px;
}
.option-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: var(--text);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.option-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-alt);
  background-size: cover;
  background-position: center;
}
.option-label {
  padding: 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* NAVIGATION ÉTAPES */
.calc-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ============================================
   AJOUTS POUR LE CALCULATEUR APPARTEMENT
   ============================================ */

/* Hero bannière de calculateur */
.calc-hero {
  position: relative;
  height: 280px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  margin-bottom: 0;
}
.calc-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%);
}
.calc-hero-content {
  position: relative;
  z-index: 1;
  color: white;
  padding: 40px 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.calc-hero-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 8px;
}
.calc-hero-title { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
@media (max-width: 768px) {
  .calc-hero { height: 200px; }
  .calc-hero-title { font-size: 26px; }
}

/* Conteneur étapes */
.step-container {
  background: var(--bg);
  padding: 48px 0 80px;
}
.step-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}
.step-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.step-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
}

/* Inputs number / text */
.field { margin-bottom: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Radio cards (sans image) */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.radio-card:hover { border-color: var(--text-muted); }
.radio-card.selected {
  border-color: var(--text);
  border-width: 2px;
  padding: 15px 19px;
}
.radio-card-label { font-size: 15px; font-weight: 500; }
.radio-card-meta { font-size: 13px; color: var(--text-muted); }

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 600px) { .checkbox-grid { grid-template-columns: 1fr; } }
.checkbox-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  user-select: none;
}
.checkbox-card:hover { border-color: var(--text-muted); }
.checkbox-card.selected {
  border-color: var(--text);
  background: #FAFAFA;
}
.checkbox-box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.checkbox-card.selected .checkbox-box {
  background: var(--text);
  border-color: var(--text);
  color: white;
}
.checkbox-card.selected .checkbox-box::after { content: '✓'; font-size: 13px; font-weight: 700; }
.checkbox-label { font-size: 15px; font-weight: 500; }

/* Boutons + / - pour quantité */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 48px;
}
.qty-btn {
  width: 48px; height: 100%;
  background: var(--bg);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition);
}
.qty-btn:hover { background: var(--bg-alt); }
.qty-value {
  width: 56px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 100%;
  font-size: 15px;
  font-weight: 500;
}
.qty-value::-webkit-outer-spin-button,
.qty-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Sélection (✓ rouge sur option-card si on veut accentuer) */
.option-card.selected::after { background: var(--text); }

/* Étape finale - récap */
.recap-section { padding: 48px 0; }
.recap-prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
@media (max-width: 768px) { .recap-prices { grid-template-columns: 1fr; } }
.recap-price-card {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
}
.recap-price-card.featured {
  background: var(--text);
  color: white;
}
.recap-price-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 8px;
}
.recap-price-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.recap-detail {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 32px;
}
.recap-detail h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.recap-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.recap-detail-row:last-child { border-bottom: none; }

/* CTA final rouge */
.btn-cta-final {
  background: var(--accent);
  color: white;
  height: 56px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 40px;
}
.btn-cta-final:hover { background: var(--accent-hover); }

/* Formulaire final */
.form-final {
  max-width: 560px;
  margin: 0 auto;
}
.form-final .field { margin-bottom: 20px; }

/* Cal.com embed */
#calcom-embed {
  min-height: 700px;
  margin-top: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Progress avec accent rouge */
.progress-fill { background: var(--text); }

/* Empty state */
.muted-text { color: var(--text-muted); font-size: 14px; }