/* ---- FORM PAGE ---- */
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.header-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-secure { font-size: 0.82rem; color: #6c757d; }

.form-page { padding: 40px 0 80px; min-height: calc(100vh - 68px); }

/* Progress */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ps-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.progress-step.active .ps-dot, .progress-step.done .ps-dot {
  background: var(--blue-light);
  color: white;
}
.progress-step span { font-size: 0.78rem; color: #6c757d; }
.progress-step.active span { color: var(--blue-light); font-weight: 600; }
.progress-line {
  flex: 1;
  height: 2px;
  background: #e9ecef;
  margin: 0 8px;
  margin-bottom: 20px;
}

/* Layout */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

/* Steps */
.form-step { display: none; background: white; border: 1px solid #e9ecef; border-radius: 16px; padding: 36px; }
.form-step.active { display: block; }
.form-step h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.step-desc { color: #6c757d; font-size: 0.9rem; margin-bottom: 28px; }
.step-actions { display: flex; gap: 12px; margin-top: 28px; }
.form-section { margin-bottom: 24px; }
.form-section h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #e9ecef; color: var(--text); }

.field-hint { font-size: 0.78rem; color: #6c757d; margin-top: 4px; }

/* Service Picker */
.service-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.sp-item {
  cursor: pointer;
  border: 2px solid #e9ecef;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
  position: relative;
}
.sp-item:hover {
  border-color: var(--blue-light);
  box-shadow: 0 6px 20px rgba(99,102,241,0.12);
  transform: translateY(-2px);
}
.sp-item input { display: none; }
.sp-item:has(input:checked) {
  border-color: var(--blue-light);
  background: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.sp-check {
  position: absolute;
  top: 8px; right: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-light);
  background: white;
  border: 1.5px solid var(--blue-light);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.sp-item:has(input:checked) .sp-check { opacity: 1; }
.sp-content {
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}
.sp-icon { font-size: 2rem; }
.sp-content strong { font-size: 0.88rem; color: var(--text); font-weight: 700; }
.sp-content small { font-size: 0.74rem; color: #6c757d; line-height: 1.4; }

/* Formule Picker */
.formule-section { margin-top: 28px; }
.formule-section h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.formule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.formule-item {
  cursor: pointer;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  transition: all 0.2s;
}
.formule-item:hover { border-color: var(--blue-light); }
.formule-item input { display: none; }
.formule-item:has(input:checked) { border-color: var(--blue-light); background: var(--blue-pale); }
.formule-featured { border-color: var(--blue-light); }
.fi-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.fi-badge {
  font-size: 0.7rem;
  background: var(--blue-light);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  align-self: flex-start;
  margin-bottom: 4px;
  font-weight: 600;
}
.fi-content strong { font-size: 0.95rem; color: var(--text); }
.fi-price { font-size: 1.1rem; font-weight: 800; color: var(--blue); }
.fi-content small { font-size: 0.78rem; color: #6c757d; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #ced4da;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone p { font-size: 0.95rem; color: #495057; }
.upload-hint { font-size: 0.82rem !important; color: #6c757d !important; margin-top: 6px; }
.upload-label { color: var(--blue-light); font-weight: 600; cursor: pointer; text-decoration: underline; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.88rem;
}
.file-item span:first-child { flex: 1; }
.file-remove { cursor: pointer; color: #dc3545; font-weight: 700; padding: 0 4px; }

.upload-tips {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.upload-tips h4 { font-size: 0.95rem; margin-bottom: 10px; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tips-list li { font-size: 0.85rem; color: #495057; padding-left: 16px; position: relative; }
.tips-list li::before { content: '•'; position: absolute; left: 0; color: var(--blue-light); }

/* Payment */
.order-summary {
  background: var(--blue-pale);
  border: 1px solid var(--blue-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.os-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 4px 0; }
.os-total { font-size: 1.1rem; font-weight: 800; border-top: 1px solid var(--blue-light); padding-top: 8px; margin-top: 8px; }

.payment-grid { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 20px; }
.payment-option {
  border: 2px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.payment-option.selected, .payment-option:has(input:checked) {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}
.payment-option input { display: none; }
.po-content { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.po-content > span { font-size: 1.5rem; }
.po-content strong { font-size: 0.9rem; display: block; }
.po-content small { font-size: 0.78rem; color: #6c757d; }

.stripe-card {
  border: 1.5px solid #ced4da;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
  background: white;
  min-height: 44px;
}
.stripe-error { color: #dc3545; font-size: 0.88rem; margin-bottom: 8px; }

.virement-info {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  font-size: 0.9rem;
  color: #495057;
  margin-bottom: 16px;
}

.legal-accept { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; }
.legal-accept input { margin-top: 3px; }
.legal-accept label { font-size: 0.85rem; color: #6c757d; }

.btn-pay { font-size: 1rem; padding: 14px 28px; }
.payment-security-note { font-size: 0.8rem; color: #6c757d; text-align: center; margin-top: 12px; }

/* Sidebar */
.form-sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: white; border: 1px solid #e9ecef; border-radius: 12px; padding: 20px; }
.sidebar-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sidebar-list li { font-size: 0.82rem; color: #495057; padding-left: 14px; position: relative; }
.sidebar-list li::before { content: '✓'; position: absolute; left: 0; color: var(--blue-light); font-size: 0.7rem; }
.sidebar-help { background: var(--blue-pale); border-color: var(--blue-light); }
.sidebar-help p { font-size: 0.82rem; color: #495057; margin-bottom: 6px; }
.sidebar-help a { font-size: 0.82rem; color: var(--blue-light); word-break: break-all; }
.summary-empty { font-size: 0.85rem; color: #6c757d; }
#sidebarSummary .sb-line { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 4px 0; }
#sidebarSummary .sb-price { font-weight: 700; color: var(--blue); }

/* Responsive */
@media (max-width: 820px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { position: static; }
  .formule-grid { grid-template-columns: 1fr; }
  .service-picker { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 600px) {
  .service-picker { grid-template-columns: repeat(2, 1fr); }
  .sp-item:hover { transform: none; }
}
@media (max-width: 500px) {
  .form-step { padding: 20px; }
  .upload-zone { padding: 24px; }
}
