html,
body {
  background: #1f2126;
  color: #f3eee6;
}

/* =========================
   HEADER CONFIG
========================= */

.config-header {
  text-align: center;
  margin: 50px 0 40px;
  padding: 50px 20px 45px;
  background: radial-gradient(circle at top, rgba(224, 193, 90, 0.08), transparent 70%);
}

.config-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 14px;
  border: 1px solid #e0c15a;
  color: #e0c15a;
  font-size: 14px;
  letter-spacing: 1px;
  background: rgba(224, 193, 90, 0.05);
  text-transform: uppercase;
  font-weight: 600;
}

.config-header h1 {
  max-width: 900px;
  margin: 0 auto 16px;
  color: #e0c15a;
  font-size: 45px;
  line-height: 1.12;
  font-weight: 800;
}

.config-header p {
  margin: 0 auto 8px;
  max-width: 820px;
  color: #f3eee6;
  font-size: 18px;
  line-height: 1.6;
}

.config-sub {
  display: inline-block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

/* =========================
   WRAP
========================= */

.configurator-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 20px 80px;
}

.configurator {
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 20px;
  margin-top: 40px;
  align-items: start;
}

/* =========================
   COLONNE GAUCHE
========================= */

.config-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-left button,
.config-right button {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(224, 193, 90, 0.55);
  color: #e0c15a;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 300;
  font-family: inherit;
}

.config-left button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}

.config-left button:hover,
.config-right button:hover {
  background: rgba(224, 193, 90, 0.1);
  color: #f3eee6;
  transform: translateY(-2px);
  border-color: #e0c15a;
}

.config-left button small {
  color: #f3eee6;
  font-size: 12px;
}

.config-left button:hover small {
  color: #f3eee6;
}

.config-left .add-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #e0c15a;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.config-left button:hover .add-label {
  color: #f3eee6;
  opacity: 1;
}

/* =========================
   ZONE PLAN
========================= */

.config-center {
  position: relative;
  width: 100%;
  height: 600px;
  border: 1px solid rgba(224, 193, 90, 0.2);
  background:
    radial-gradient(circle at center, rgba(224, 193, 90, 0.06), transparent 72%),
    linear-gradient(180deg, #1c1f24 0%, #16181c 100%);
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.28);
}

.config-center::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(224, 193, 90, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 193, 90, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.config-center::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

/* =========================
   MODULES
========================= */

.module {
  position: absolute;
  border: 2px solid rgba(224, 193, 90, 0.85);
  background: linear-gradient(145deg, #343840, #262a31);
  color: #e0c15a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
  box-sizing: border-box;
  text-align: center;
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
  z-index: 2;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 8px rgba(224, 193, 90, 0.12);
}

.module:hover {
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.42),
    inset 0 0 12px rgba(224, 193, 90, 0.15);
}

.module:active {
  cursor: grabbing;
  transform: scale(1.02);
}

.module.selected {
  box-shadow:
    0 0 0 3px rgba(224, 193, 90, 0.22),
    0 10px 20px rgba(0, 0, 0, 0.42);
  background: linear-gradient(145deg, #3b4048, #2b2f36);
}

/* =========================
   COLONNE DROITE
========================= */

.config-right {
  padding: 18px;
  border: 1px solid rgba(224, 193, 90, 0.24);
  background: linear-gradient(180deg, rgba(35, 38, 44, 0.95), rgba(28, 31, 36, 0.95));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.config-right h3 {
  color: #e0c15a;
  margin: 0 0 15px;
  font-size: 34px;
  line-height: 1.05;
}

#summary {
  color: #e0c15a;
  margin-bottom: 18px;
  line-height: 1.6;
  min-height: 110px;
  white-space: pre-line;
}

.config-right button:last-of-type {
  background: linear-gradient(135deg, #e0c15a, #caa94a);
  color: #1f2126;
  font-weight: 700;
  border-color: #e0c15a;
}

.config-right button:last-of-type:hover {
  background: linear-gradient(135deg, #ebcd66, #d7b24d);
  color: #1f2126;
  box-shadow: 0 12px 30px rgba(224, 193, 90, 0.2);
}

/* =========================
   TEXTE BAS + CTA
========================= */

.config-info {
  max-width: 900px;
  margin: 0 auto 50px;
  padding: 10px 20px 0;
  text-align: center;
}

.config-info p {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.config-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 14px 28px;
  border: none;
  background: linear-gradient(135deg, #e0c15a, #caa94a);
  color: #1f2126;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.config-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(224, 193, 90, 0.28);
  color: #1f2126;
}

/* =========================
   POPUP
========================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #1f2126;
  border: 1px solid #e0c15a;
  padding: 28px;
  color: #f3eee6;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.modal-content h3 {
  margin: 0 0 10px;
  color: #e0c15a;
  font-size: 28px;
}

.modal-text {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  background: #2a2d33;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f3eee6;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.modal-content select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.modal-content input:hover,
.modal-content textarea:hover,
.modal-content select:hover {
  border-color: rgba(224, 193, 90, 0.4);
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: #e0c15a;
  box-shadow: 0 0 0 2px rgba(224, 193, 90, 0.12);
}

.modal-content textarea {
  min-height: 110px;
  resize: vertical;
}

.modal-content button[type="submit"],
.modal-confirm-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  background: linear-gradient(135deg, #e0c15a, #caa94a);
  color: #1f2126;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.modal-content button[type="submit"]:hover,
.modal-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(224, 193, 90, 0.22);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  color: #e0c15a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.check-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
}

.check-line input {
  width: auto;
  margin: 3px 0 0;
  accent-color: #e0c15a;
  transform: scale(1.1);
}

.hidden-field {
  display: none !important;
}

/* =========================
   RESPONSIVE TABLETTE
========================= */

@media (max-width: 900px) {
  .config-header {
    margin: 30px 0 20px;
    padding: 28px 18px 24px;
  }

  .config-tag {
    font-size: 11px;
    padding: 6px 10px;
    margin-bottom: 12px;
  }

  .config-header h1 {
    font-size: 34px;
    line-height: 1.12;
    max-width: 700px;
  }

  .config-header p {
    font-size: 15px;
    max-width: 620px;
  }

  .config-sub {
    font-size: 13px;
  }

  .configurator-wrap {
    padding: 0 18px 50px;
  }

  .configurator {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
  }

  .config-left {
    gap: 10px;
  }

  .config-left button {
    padding: 12px 14px;
    font-size: 14px;
  }

  .config-left button small {
    font-size: 12px;
  }

  .config-center {
    height: 420px;
    order: 2;
  }

  .config-right {
    order: 3;
    padding: 16px;
  }

  .config-right h3 {
    font-size: 28px;
    margin-bottom: 12px;
  }

  #summary {
    min-height: auto;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
  }

  .config-right button {
    padding: 12px;
    font-size: 14px;
  }

  .config-info {
    margin: 0 auto 40px;
    padding: 0 18px;
  }

  .config-info p {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 18px;
  }

  .config-cta {
    padding: 13px 24px;
    font-size: 14px;
  }
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 640px) {
  .config-left {
    align-items: center;
    margin-top: -30px;
  }

  .config-left button {
    width: 100%;
    max-width: 240px;
  }

  .config-header {
    margin: 18px 0 12px;
    padding: 20px 14px 18px;
    background: radial-gradient(circle at top, rgba(224, 193, 90, 0.06), transparent 72%);
  }

  .config-tag {
    font-size: 10px;
    font-weight: 400;
    padding: 5px 9px;
    margin-bottom: 10px;
    letter-spacing: 0.08em;
  }

  .config-header h1 {
    font-size: 26px;
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .config-header p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    margin-bottom: 6px;
  }

  .config-sub {
    font-size: 12px;
    font-weight: 400;
  }

  .configurator-wrap {
    padding: 0 14px 34px;
    margin-left: -5px;
  }

  .configurator {
    gap: 14px;
    margin-top: 14px;
    margin-left: -18px;
  }

  .config-left {
    gap: 8px;
  }

  .config-left button {
    padding: 11px 10px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }

  .config-left button small {
    font-size: 11px;
    font-weight: 400;
    display: block;
    margin-top: 2px;
    text-align: center;
  }

  .config-left .add-label {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 500;
  }

  .config-center {
    height: 270px;
    min-height: 270px;
  }

  .config-center::before {
    background-size: 30px 30px;
  }

  .module {
    font-size: 10px;
    font-weight: 400;
    box-shadow: 0 0 12px rgba(224, 193, 90, 0.25);
  }

  .config-right {
    padding: 14px;
  }

  .config-right h3 {
    font-size: 22px;
    margin-bottom: 10px;
  }

  #summary {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
    font-weight: 400;
  }

  .config-right button {
    padding: 11px 10px;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 400;
  }

  .config-info {
    margin: 0 auto 28px;
    padding: 0 14px;
  }

  .config-info p {
    font-size: 18px;
    line-height: 1.55;
    margin-bottom: 16px;
    font-weight: 400;
  }

  .config-cta {
    width: 100%;
    max-width: 220px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
  }

  .modal {
    padding: 14px;
  }

  .modal-content {
    padding: 18px 16px;
  }

  .modal-content h3 {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .modal-text {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .modal-content input,
  .modal-content textarea,
  .modal-content select {
    font-size: 14px;
    padding: 11px;
  }

  .modal-content button[type="submit"],
  .modal-confirm-btn {
    padding: 12px;
    font-size: 14px;
  }

  .check-line {
    font-size: 13px;
  }
}

/* =========================
   TRÈS PETITS ÉCRANS
========================= */

@media (max-width: 400px) {
  .config-header h1 {
    font-size: 23px;
  }

  .config-center {
    height: 240px;
    min-height: 240px;
  }

  .config-right h3 {
    font-size: 20px;
  }

  .config-left button,
  .config-right button {
    font-size: 12px;
  }
}