/* ============================================================
   FACILITIX — calculator.css + forms.css
   Styles pour le calculateur de devis et les formulaires
   ============================================================ */

/* ── Page header (calculateur, formulaire, webinaires) ─────── */
.page-hero {
  padding-top: var(--nav-h);
  background: linear-gradient(135deg, #0A1628, #0A2540);
  color: white;
  padding-bottom: 48px;
  text-align: center;
}
.page-hero .container { padding-top: 48px; }
.page-hero h1 { color: white; margin-bottom: 10px; }
.page-hero p { opacity: 0.8; font-size: 1.1rem; }

/* ── Calculator wrapper ───────────────────────────────────── */
.calc-wrapper {
  max-width: 820px;
  margin: -40px auto 64px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.calc-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
  overflow: hidden;
}
.calc-header {
  background: var(--primary-light);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.calc-header-title { font-weight: 700; font-size: 1rem; color: var(--primary); }
.calc-header-step { font-size: 0.85rem; color: var(--text-muted); }
.calc-body { padding: 36px 32px; }
@media (max-width: 640px) {
  .calc-wrapper { margin-top: -20px; padding: 0 12px; }
  .calc-body { padding: 24px 20px; }
  .calc-header { padding: 16px 20px; }
}

/* ── Step blocks ──────────────────────────────────────────── */
.calc-step { display: none; }
.calc-step.active { display: block; }
.calc-step h2 { font-size: 1.35rem; margin-bottom: 6px; }
.calc-step .step-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 28px; }

/* Product selection grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
  margin-top: 10px;
}
.product-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: #FAFBFD;
}
.product-option:hover { border-color: var(--primary); background: var(--primary-light); }
.product-option.selected { border-color: var(--primary); background: var(--primary-light); }
.product-option input { position: absolute; opacity: 0; }
.product-option-icon { font-size: 1.2rem; flex-shrink: 0; }
.product-option-text { }
.product-option-name { font-size: 0.88rem; font-weight: 600; }
.product-option-code { font-size: 0.74rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Transport mode buttons */
.transport-btns {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.transport-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #FAFBFD;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.transport-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.transport-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.transport-btn .t-icon { font-size: 1.6rem; }
.transport-btn .t-name { font-size: 0.88rem; font-weight: 600; }
.transport-btn .t-sub { font-size: 0.74rem; color: var(--text-muted); }

/* Country destination select */
.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Quote result ─────────────────────────────────────────── */
.quote-result { animation: slideIn 0.35s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.quote-header-left h2 { font-size: 1.3rem; color: var(--primary); }
.quote-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.quote-validity { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.quote-section { margin-bottom: 24px; }
.quote-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
}
.quote-section-head h4 { font-size: 0.92rem; color: var(--primary); }
.quote-section-total { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 700; color: var(--primary); }
.quote-section-icon { font-size: 1rem; color: var(--primary); transition: transform var(--transition); }
.quote-section-head.collapsed .quote-section-icon { transform: rotate(-90deg); }

.quote-lines { background: #FAFBFD; border-radius: 0 0 var(--radius-sm) var(--radius-sm); overflow: hidden; }
.quote-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.85rem;
}
.quote-line:last-child { border-bottom: none; }
.quote-line-info { flex: 1; }
.quote-line-name { font-weight: 600; }
.quote-line-detail { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.quote-line-amount { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; margin-left: 16px; }

.quote-totals {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 8px;
}
.quote-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.quote-total-row + .quote-total-row { border-top: 1px solid var(--border); }
.quote-total-row .label { font-size: 0.92rem; color: var(--text-muted); }
.quote-total-row .amount { font-family: var(--font-mono); font-weight: 700; }
.quote-total-row.main {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 8px;
}
.quote-total-row.main .label { color: rgba(255,255,255,0.85); font-size: 1rem; }
.quote-total-row.main .amount {
  font-size: 1.3rem;
  color: white;
}

.quote-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #FAFBFD;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left: 3px solid var(--border);
  margin-top: 16px;
  line-height: 1.7;
}
.quote-cemac-note {
  background: rgba(39,174,96,0.08);
  border-left-color: var(--success);
  color: #155724;
}

.quote-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.quote-cta {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Compare multi-modes */
.compare-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 12px; }
.compare-table th { background: var(--primary); color: white; padding: 10px 12px; text-align: left; }
.compare-table th:not(:first-child) { text-align: right; }
.compare-table td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; }
.compare-table td:not(:first-child) { text-align: right; font-family: var(--font-mono); }
.compare-table tr:last-child td { border-bottom: none; font-weight: 700; }
.compare-table .best-cell { color: var(--success); font-weight: 700; }

/* ── Nav buttons ──────────────────────────────────────────── */
.calc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.calc-nav-info { font-size: 0.82rem; color: var(--text-muted); }
@media (max-width: 500px) { .transport-btns { grid-template-columns: 1fr 1fr; } .product-grid { grid-template-columns: 1fr; } }

/* ── Form dossier wrapper ─────────────────────────────────── */
.dossier-wrapper {
  max-width: 760px;
  margin: -40px auto 64px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.dossier-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
  padding: 36px;
}
@media (max-width: 640px) {
  .dossier-wrapper { margin-top: -20px; padding: 0 12px; }
  .dossier-card { padding: 24px 20px; }
}

/* ── Webinaire cards ──────────────────────────────────────── */
.wbn-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; margin-bottom: 40px; }
.wbn-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.wbn-card:hover { border-color: var(--primary); }
.wbn-card.featured { border-color: var(--accent); }
.wbn-format {
  position: absolute; top: 20px; right: 20px;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
}
.wbn-format.gratuit { background: rgba(39,174,96,0.12); color: var(--success); }
.wbn-format.premium { background: rgba(255,107,53,0.12); color: var(--accent-dark); }
.wbn-date { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.wbn-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.wbn-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }
.wbn-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.wbn-inscription {
  max-width: 540px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 640px) { .wbn-grid { grid-template-columns: 1fr; } }

/* ── Grid helpers for forms ───────────────────────────────── */
.grid-form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-form-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .grid-form-2, .grid-form-3 { grid-template-columns: 1fr; }
  .dest-grid { grid-template-columns: 1fr; }
  .quote-cta { grid-template-columns: 1fr; }
}

/* Section titles in forms */
.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-dark);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  margin: 24px 0 16px;
}

/* Summary table */
.summary-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.summary-table tr { border-bottom: 1px solid #F1F5F9; }
.summary-table td { padding: 9px 4px; vertical-align: top; }
.summary-table td:first-child { color: var(--text-muted); font-weight: 600; width: 44%; }
.summary-section-header td {
  padding-top: 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-dark);
  font-weight: 700;
  border-bottom: none;
}

/* ── Quote sections (result rendering) ── */
.quote-section {
  margin-bottom: 24px;
}
.quote-section-header {
  padding: 12px 16px;
  background: var(--primary, #0066CC);
  border-radius: 8px 8px 0 0;
  color: #fff;
}
.quote-section-title {
  font-size: 1rem;
  font-weight: 700;
}
.quote-section-sub {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 2px;
}
.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.quote-table thead tr {
  background: #0a2540;
  color: #fff;
}
.quote-table thead th {
  padding: 8px 10px;
  font-weight: 600;
  text-align: left;
}
.quote-table tbody tr.alt {
  background: #f8fafc;
}
.quote-table tbody tr.negative-row td:last-child {
  color: #27AE60 !important;
}
.quote-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.quote-section-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #dbeafe;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0066CC;
}
