/* L21STUDIOS — Forms CSS
   Formulaires multi-étapes pour réservation et impression photo.
*/

/* ---------- Layout formulaire ---------- */
.form-shell {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: clamp(28px, 5vw, 48px);
  margin: 32px 0;
}

.form-page {
  padding: clamp(60px, 8vw, 80px) 0 60px;
  background: var(--bg);
  min-height: calc(100vh - var(--nav-h));
}

.form-page-head {
  text-align: center;
  margin-bottom: 32px;
}

.form-page-head h1 {
  font-size: clamp(38px, 5.5vw, 60px);
  margin-bottom: 12px;
}

.form-page-head p {
  color: var(--muted);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 32px auto 40px;
  max-width: 720px;
  flex-wrap: wrap;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stepper-item .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  transition: all 0.2s;
}

.stepper-item.active .dot {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.stepper-item.done .dot {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.stepper-item.active .label,
.stepper-item.done .label {
  color: var(--ink);
}

.stepper-bar {
  width: 36px;
  height: 1.5px;
  background: var(--line);
  margin: 0 6px;
}

.stepper-item.done + .stepper-bar {
  background: var(--ink);
}

@media (max-width: 640px) {
  .stepper {
    gap: 0;
  }
  .stepper-item .label {
    display: none;
  }
  .stepper-bar {
    width: 18px;
  }
}

/* ---------- Step content ---------- */
.step {
  display: none;
  animation: stepIn 0.35s ease;
}

.step.active {
  display: block;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin: 0 0 8px;
}

.step-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 28px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.field-grid > .full {
  grid-column: 1 / -1;
}

.field {
  margin-bottom: 16px;
}

.field-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.field.invalid .field-error {
  display: block;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--red);
}

@media (max-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .field-grid.three {
    grid-template-columns: 1fr;
  }
}

/* ---------- Téléphone avec indicatif ---------- */
.phone-input {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
}

/* ---------- Choix multiples (chips) ---------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.selected {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Cards radio (paiement, méthode) ---------- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.choice-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-card:hover {
  border-color: var(--ink);
}

.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-card .choice-title {
  font-weight: 600;
  font-size: 15px;
}

.choice-card .choice-desc {
  font-size: 13px;
  color: var(--muted);
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Articulations (déroulé événement) ---------- */
.articulations {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.articulation-card {
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  padding: 18px;
  position: relative;
}

.articulation-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.articulation-card .head h5 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.articulation-card .remove {
  color: var(--red);
  font-size: 13px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-xs);
}

.articulation-card .remove:hover {
  background: rgba(255, 59, 48, 0.08);
}

.add-articulation {
  margin-top: 8px;
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  width: 100%;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.add-articulation:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- Navigation formulaire ---------- */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.form-nav .spacer {
  flex: 1;
}

/* ---------- Récapitulatif ---------- */
.recap {
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.recap h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.recap-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  gap: 16px;
}

.recap-row:last-child {
  border-bottom: 0;
}

.recap-row .label {
  color: var(--muted);
  margin-bottom: 0;
  font-weight: 400;
}

.recap-row .value {
  text-align: right;
  font-weight: 500;
  max-width: 60%;
}

.recap-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  padding: 18px 0 4px;
  border-top: 2px solid var(--ink);
  margin-top: 16px;
}

/* ---------- Upload zone ---------- */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-soft);
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone svg {
  width: 56px;
  height: 56px;
  color: var(--muted);
  margin: 0 auto 14px;
}

.upload-zone h4 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 8px;
}

.upload-zone p {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 14px;
}

.upload-zone input[type="file"] {
  display: none;
}

/* ---------- Liste photos ---------- */
.photos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.photo-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  position: relative;
}

.photo-item .photo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border-radius: var(--r-xs);
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}

.photo-item .photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .photo-name {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-item .photo-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-item .qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
}

.photo-item .qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-item .qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.photo-item .qty button:hover {
  background: var(--line);
}

.photo-item .qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 500;
}

.photo-item .remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.photo-item .photo-price {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.photo-item .photo-price b {
  font-weight: 600;
}

/* ---------- OTP ---------- */
.otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.otp-row input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
}

.otp-dev-hint {
  text-align: center;
  background: rgba(255, 159, 10, 0.1);
  color: #92400e;
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ---------- Save draft indicator ---------- */
.draft-indicator {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: rgba(29, 29, 31, 0.92);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.draft-indicator.show {
  opacity: 1;
  transform: none;
}

.draft-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
