/**
 * BWA Advice Wizard - Front-end Styles
 * Two-column layout with AJAX loading
 */

.bwaadvice-wizard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wizard-container__header {
  margin-bottom: 85px;
}

.wizard-container__header h4 {
  color: var(--color-secondary);
  text-align: center;
  font-size: 30px;
  font-style: normal;
  font-weight: 800;
  line-height: 40px; /* 133.333% */
  text-transform: uppercase;
  margin: 10px 0;
}

.wizard-container__header p {
  color: var(--color-secondary);
  text-align: center;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%;
  max-width: 700px;
  margin: 0 auto;
}

.contact-advice-infos .contact-advice-name {
  color: var(--color-secondary);
  text-align: center;
  font-size: 30px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.contact-advice-infos {
  max-width: 380px;
  margin: 30px 0;
}

.contact-advice-name {
  margin: 20px 0 30px;
}

.subtitle-contact-advice {
  color: var(--color-secondary);
  text-align: center;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  text-transform: uppercase;
}

.contact-advice-infos .contact-advice-mission {
  color: var(--color-secondary);
  text-align: center;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 160%; /* 25.6px */
}



/* Two-column container */
.wizard-container {
    display: flex;
    min-height: 500px;
}

/* Left Sidebar - Subjects */
.wizard-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--color-primary);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.subjects-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-family: system-ui, sans-serif;
  margin-bottom: 30px;
}

.subject-card {
  position: relative;
  width: 200px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid #ffffff;
}

.wizard-content {
  position: relative;
}

.wizard-form-container,.wizard-form-content  {
  height: 100%;
}

.wizard-content form {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%,-50%);
  max-width: 520px;
}

.wizard-form-content img.bg_step {
  height: 100%;
  object-fit: cover;
}

.subject-card.active {
  border: 2px solid var(--color-primary);
}

  /* Radio indicator */
.subject-radio {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  z-index: 2;
  transition: all 0.2s ease;
  box-sizing: border-box;
  border: 1px solid var(--color-primary);
}

.subject-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #DB0345;
  transition: transform 0.2s ease;
}

.subject-card.active .subject-radio {
  border-color: var(--color-primary);
}

.subject-card.active .subject-radio::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Opacity: when a card is selected, dim the others */
.subjects-list.has-selection .subject-card {
  opacity: 0.6;
}

.subjects-list.has-selection .subject-card.active {
  opacity: 1;
}

.wizard-sidebar__inner {
  width: 100%;
}

.subject-card .subject-image {
  width: 200px;
}

.subject-card .subject-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.subject-card .subject-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subject-card .subject-name {
  color: #FFF;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  text-transform: uppercase;
}

.subject-card .subject-description {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Content - Form Area */
.wizard-content {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08)
}

/* Placeholder state */
.wizard-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #999;
    text-align: center;
}

.wizard-placeholder img {
  height: 100%;
  object-fit: cover;
}

.wizard-placeholder .placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.wizard-placeholder .placeholder-icon .material-icons {
    font-size: 64px;
}

.wizard-placeholder p {
    font-size: 1.1rem;
    margin: 0;
}

/* Loading state */
.wizard-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.wizard-form-container.loading .wizard-loading {
    display: flex;
}

.wizard-form-container.loading .wizard-form-content {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Header */
.form-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.form-title {
    font-size: 1.3rem;
    margin: 0;
    color: #333;
}

/* Progress bar */
.wizard-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.progress-step {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    padding: 8px 4px;
    background: #f5f5f5;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.progress-step.active {
    color: #fff;
    background: #007bff;
    font-weight: 600;
}

.progress-step.completed {
    color: #fff;
    background: #28a745;
}

/* Form steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.form-step h3 {
  color: #FFF;
  text-align: center;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 120%; /* 16.8px */
  text-transform: uppercase;
}

.form-step .step-description {
  color: #FFF;
  text-align: center;
  font-size: 30px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.step-fields-wrapper {
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px ;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    /*display: block;*/
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    display: none;
}

.wizard-form-content .form-group {
  margin: 0;
}

.wizard-form-content input[type='text'],.wizard-form-content input[type='number'],.wizard-form-content input[type='tel'],.wizard-form-content input[type='email'] {
  height: 50px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.65);
  border: none;

  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  padding-left: 10px;

  color: var(--color-secondary);
}

.wizard-form-content input[type='text']::placeholder,.wizard-form-content input[type='number']::placeholder,.wizard-form-content input[type='tel']::placeholder,.wizard-form-content input[type='tel']::placeholder  {
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  padding-left: 10px;
  color: var(--color-secondary);
  text-transform: initial;
}

.form-group .required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: rgba(255, 255, 255, 0.15) !important;
}

.form-group.field-textarea {
  grid-column: 1/3;
}

.form-control:focus {
  color: #ffffff !important;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    color: #FFF;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.subjects-list--step {
  margin-top:35px;
}

textarea.form-control::placeholder {
  color: #FFF;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.form-control-file {
    padding: 10px 0;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* Radio and Checkbox options */
.radio-options,
.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.radio-option.selected,
.checkbox-option.selected {
    border-color: #007bff;
    background: #e7f1ff;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.option-label {
    font-size: 0.95rem;
}

/* Options with images */
.radio-options.has-images,
.checkbox-options.has-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.has-images .radio-option,
.has-images .checkbox-option {
    flex-direction: column;
    text-align: center;
    padding: 15px;
    position: relative;
}

.has-images .radio-option input,
.has-images .checkbox-option input {
    position: absolute;
    top: 10px;
    right: 10px;
}

.option-image {
    width: 100%;
    max-width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Navigation buttons */
.wizard-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    gap: 15px;
}

.wizard-navigation .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.wizard-navigation .btn-secondary.btn-prev {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    text-transform: initial;
}

.wizard-navigation .btn-secondary:hover {
    opacity: 0.7;
}

.wizard-navigation .btn-primary {
    background: #fff;
    color: #1F1F1F;
    text-transform: initial;
    transition: 0.3s ease;
}

.wizard-navigation .btn-primary:focus {
  border: none !important;
  outline: none !important;
}

input#customer_email {
  height: 100%;
  border-radius: 3px;
}

.wizard-navigation .btn-next {
  color: var(--color-secondary);
  font-family: Urbanist,system-ui;
  font-size: 15px;
  font-style: normal;
  font-weight: 600;
  line-height: 110%; /* 16.5px */
  letter-spacing: 0.45px;
  text-transform: initial;
  height: 46px;
}

.wizard-navigation .btn-primary:hover {
  opacity: 0.7;
}

.wizard-navigation .btn-success {
    background: #28a745;
    color: #fff;
}

.wizard-navigation .btn-success:hover {
    background: #218838;
}

.wizard-navigation .btn .material-icons {
    font-size: 18px;
}

.wizard-navigation .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Validation states */
.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.radio-options.is-invalid,
.checkbox-options.is-invalid {
    border: 2px solid #dc3545;
    padding: 10px;
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.step-fields-wrapper {
  margin-top: 35px;
}

/* Success step */
.bwaadvice-success {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.bwaadvice-success h3 {
  color: #FFF;
  text-align: center;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  text-transform: uppercase;
}

.bwaadvice-success .step-description {
  color: #FFF;
  text-align: center;
  font-size: 30px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

/* ===========================
   Responsive
   =========================== */

/* Desktop large : 2 colonnes égales */
@media screen and (min-width: 1200px) {
  .wizard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablette (≤ 992px) : layout empilé + form en flux normal */
@media (max-width: 992px) {
  .wizard-container {
    flex-direction: column;
    min-height: 0;
  }

  /* Header */
  .wizard-container__header {
    margin-bottom: 40px;
  }

  .wizard-container__header h4 {
    font-size: 22px;
    line-height: 30px;
  }

  /* Sidebar */
  .wizard-sidebar {
    width: 100%;
    position: static;
    border: none;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 20px;
  }

  .contact-advice-infos {
    margin: 20px auto;
    text-align: center;
  }

  /* Subject cards : 2 colonnes, hauteur fixe */
  .subjects-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .subject-card {
    flex: 1;
    min-width: 140px;
    max-width: calc(50% - 6px);
    height: 180px;
  }

  .subject-card .subject-image {
    width: 100%;
    height: 180px;
  }

  .subject-card .subject-image img {
    height: 180px;
  }

  /* Contenu : on passe le formulaire en flux normal */
  .wizard-content {
    min-height: 0;
  }

  .wizard-form-container,
  .wizard-form-content {
    height: auto;
  }

  /* Cacher l'image de fond (conçue pour desktop) */
  .wizard-form-content img.bg_step {
    display: none;
  }

  /* Formulaire : sortir du positionnement absolu */
  .wizard-content form {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    max-width: 100%;
    padding: 30px 24px;
  }

  .subjects-list {
    margin-bottom: 0;
  }

  /* Fond sombre pour que le texte blanc reste lisible */
  .wizard-form-content {
    background: var(--color-primary);
    padding: 0;
  }

  /* Champs : 1 colonne */
  .step-fields-wrapper {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .form-group.field-textarea {
    grid-column: auto;
  }

  /* Navigation */
  .wizard-navigation {
    margin-top: 20px;
    padding-top: 16px;
  }

  /* Success : sortir du positionnement absolu */
  .bwaadvice-success {
    position: static;
    transform: none;
    padding: 50px 24px;
    background: var(--color-secondary);
  }
}

/* Mobile (≤ 576px) */
@media (max-width: 576px) {
  .bwaadvice-wizard {
    padding: 10px;
  }

  /* Header */
  .wizard-container__header {
    margin-bottom: 24px;
  }

  .wizard-container__header h4 {
    font-size: 18px;
    line-height: 26px;
  }

  .wizard-container__header p {
    font-size: 14px;
  }

  /* Sidebar */
  .contact-advice-infos .contact-advice-name {
    font-size: 22px;
  }

  .contact-advice-infos .contact-advice-mission {
    font-size: 14px;
  }

  /* Subject cards : 2 colonnes, hauteur réduite */
  .subjects-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .subject-card {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 6px);
    height: 140px;
  }

  .subject-card .subject-image {
    height: 140px;
  }

  .subject-card .subject-image img {
    height: 140px;
  }

  /* Formulaire */
  .wizard-content form {
    padding: 20px 16px;
  }

  .form-step h3 {
    font-size: 12px;
  }

  .form-step .step-description,
  .bwaadvice-success .step-description {
    font-size: 22px;
  }

  /* Navigation : boutons empilés */
  .wizard-navigation {
    flex-direction: column;
    gap: 10px;
  }

  .wizard-navigation .btn {
    width: 100%;
    justify-content: center;
  }

  /* Options avec images : 2 colonnes */
  .radio-options.has-images,
  .checkbox-options.has-images {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Progress */
  .progress-steps {
    flex-wrap: wrap;
  }

  .progress-step {
    flex: none;
    min-width: calc(50% - 5px);
  }

  /* Success */
  .bwaadvice-success {
    padding: 40px 16px;
    gap: 12px;
  }

  .bwaadvice-success h3 {
    font-size: 12px;
  }
}
