/* ============================================================
   LippyLipo — Modal + multi-step form + body picker
   ============================================================ */

/* ---------- Modal shell ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
  visibility: hidden;
}
.modal-root.open { pointer-events: auto; visibility: visible; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 24, 18, 0.65);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-root.open .modal-backdrop { opacity: 1; }
.modal-sheet {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -45%) scale(0.96);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(.2,.8,.2,1), transform 0.35s cubic-bezier(.2,.8,.2,1);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 80px -20px rgba(31, 24, 18, 0.25), 0 0 80px -20px rgba(178, 106, 82, 0.2);
}
.modal-root.open .modal-sheet {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ---------- Multi-step form sheet ---------- */
.form-sheet {
  width: min(680px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
}
.form-header {
  position: sticky;
  top: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 10;
  flex-shrink: 0;
}
.form-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  z-index: -1;
}
.form-progress {
  height: 3px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.form-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rg-3), var(--rg-1));
  transition: width 0.55s cubic-bezier(.2,.8,.2,1);
  width: 33%;
}
.form-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 18px;
  gap: 16px;
}
.form-step-counter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-step-counter .eyebrow {
  font-size: 10px;
  letter-spacing: 0.28em;
}
.form-step-title {
  font-size: 22px;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.form-close-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: transparent;
  color: var(--text);
  transition: all 0.2s ease;
}
.form-close-btn:hover { border-color: var(--rg-3); color: var(--rg-1); }

.form-body { padding: 24px; flex: 1 1 auto; }

.form-step { display: none; }
.form-step.active { display: block; animation: stepIn 0.45s cubic-bezier(.2,.8,.2,1); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-step-sub {
  font-size: 14px;
  color: var(--mute);
  margin: 0 0 22px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}
.field-helper {
  font-size: 12px;
  color: var(--mute);
  margin: -2px 0 6px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}

.form-input,
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
  background: rgba(255,255,255,0.7);
  border: 1.5px solid var(--line);
  color: var(--text);
  padding: 13px 14px;
  border-radius: var(--r-sm);
  outline: none;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--rg-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(178,106,82,0.12);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--mute-2); }

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b5f54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
  cursor: pointer;
}

/* ---------- Area tiles (Step 1) ---------- */
.area-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 520px) { .area-grid { grid-template-columns: repeat(2, 1fr); } }
.select-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  font-family: inherit;
}
.select-tile .select-tile-icon {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(178,106,82,0.10);
  color: var(--rg-1);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.select-tile span { font-size: 14px; }
.select-tile:hover {
  border-color: var(--rg-3);
  background: #fff;
  transform: translateY(-1px);
}
.select-tile.selected {
  border-color: var(--rg-2);
  background: rgba(178,106,82,0.08);
  box-shadow: 0 14px 30px -18px rgba(124,63,48,0.3);
}
.select-tile.selected .select-tile-icon {
  background: var(--rose-gold);
  color: #fff;
}

/* ---------- Consult cards (Step 2) ---------- */
.consult-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.select-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text);
}
.select-card:hover {
  border-color: var(--rg-3);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -22px rgba(124,63,48,0.25);
}
.select-card-icon {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: rgba(178,106,82,0.10);
  color: var(--rg-1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.select-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.select-card-title {
  font-size: 20px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.15;
}
.select-card-desc {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.5;
}
.select-card-check {
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: transparent;
  background: #fff;
  transition: all 0.2s ease;
}
.select-card.selected {
  border-color: var(--rg-2);
  background: linear-gradient(135deg, rgba(200,134,112,0.05), rgba(178,106,82,0.10));
  box-shadow: 0 18px 40px -22px rgba(124,63,48,0.35);
}
.select-card.selected .select-card-icon {
  background: var(--rose-gold);
  color: #fff;
}
.select-card.selected .select-card-check {
  background: var(--rose-gold);
  border-color: var(--rose-gold);
  color: #fff;
}

/* ---------- Step 3 success ---------- */
.form-success {
  text-align: center;
  padding: 8px 0 28px;
}
.success-mark-lg {
  width: 88px; height: 88px;
  border-radius: 999px;
  background: var(--rose-gold);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  box-shadow: 0 16px 50px -10px rgba(124,63,48,0.45), inset 0 0 0 1px rgba(255,255,255,0.35);
  animation: successPop 0.6s cubic-bezier(.2,.8,.2,1.2);
}
@keyframes successPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.form-success svg path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: checkDraw 0.6s 0.25s ease-out forwards; }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }
.form-success-title {
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--text);
}
.form-success-sub {
  color: var(--mute);
  font-size: 15px;
  line-height: 1.55;
  max-width: 40ch;
  margin: 0 auto;
}

.form-section-divider {
  position: relative;
  text-align: center;
  margin: 28px 0 26px;
  border-top: 1px solid var(--line);
}
.form-section-divider span {
  position: relative;
  top: -10px;
  background: var(--panel);
  padding: 0 14px;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--rg-1);
  font-weight: 600;
}

.form-optional-intro {
  text-align: center;
  margin-bottom: 22px;
}
.form-optional-intro h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--text);
}
.form-optional-intro p {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Date input group ---------- */
.date-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-group input { width: 100%; text-align: center; letter-spacing: 0.04em; }
.date-sep { color: var(--mute-2); font-size: 16px; font-weight: 500; }

/* ---------- Pill toggle ---------- */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,0.6);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.pill:hover { border-color: var(--rg-3); }
.pill.selected {
  background: var(--rose-gold);
  border-color: var(--rose-gold);
  color: #fff;
  box-shadow: 0 8px 24px -12px rgba(124,63,48,0.4);
}

/* ---------- Metric inputs ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr 1fr 1fr; } }
.input-suffix { position: relative; }
.input-suffix .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  pointer-events: none;
  font-weight: 500;
}
.input-suffix input { padding-right: 40px; }

/* ---------- Checkbox grid ---------- */
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 520px) { .check-grid { grid-template-columns: 1fr; } }
.check-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 14px;
  color: var(--text);
  position: relative;
}
.check-tile:hover { border-color: var(--rg-3); }
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.check-tile .check-box {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
  color: transparent;
}
.check-tile input:checked + .check-box {
  background: var(--rose-gold);
  border-color: var(--rose-gold);
  color: #fff;
}
.check-tile:has(input:checked) {
  border-color: var(--rg-2);
  background: rgba(178,106,82,0.07);
}

/* ---------- Form footer ---------- */
.form-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  gap: 12px;
  z-index: 10;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex-shrink: 0;
}
.form-footer .btn { padding: 12px 20px; font-size: 14px; }
.form-footer .btn[disabled] { opacity: 0.35; pointer-events: none; }
.form-footer-right { display: flex; gap: 10px; align-items: center; }

@media (max-width: 480px) {
  .form-header-row { padding: 16px 18px 14px; }
  .form-step-title { font-size: 19px; }
  .form-body { padding: 18px; }
  .form-footer { padding: 12px 18px; }
}

/* ============================================================
   Body picker — clickable female silhouette
   ============================================================ */
.body-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 12px 12px;
  background: rgba(178, 106, 82, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-top: 2px;
}
.body-picker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.body-picker-label {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}
.body-fig {
  width: 100%;
  max-width: 150px;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.body-fig .body-deco {
  fill: rgba(178, 106, 82, 0.05);
  stroke: rgba(31, 24, 18, 0.45);
  stroke-width: 1.3;
  stroke-linejoin: round;
  pointer-events: none;
}
.body-region {
  fill: rgba(178, 106, 82, 0.04);
  stroke: rgba(31, 24, 18, 0.42);
  stroke-width: 1;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}
.body-region:hover {
  fill: rgba(178, 106, 82, 0.20);
  stroke: var(--rg-2);
  stroke-width: 1.2;
}
.body-region.selected {
  fill: rgba(178, 106, 82, 0.62);
  stroke: var(--rg-1);
  stroke-width: 1.2;
}

/* Selected-region pill summary below the silhouette */
.body-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
  min-height: 0;
}
.body-picker:has(.body-region.selected) .body-tags { margin-top: 8px; }
.body-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--rose-gold);
  color: #fff;
  font-weight: 500;
  animation: tagIn 0.3s cubic-bezier(.2,.8,.2,1);
}
@keyframes tagIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.body-tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.body-tag-x:hover { background: rgba(255,255,255,0.4); }

@media (max-width: 480px) {
  .body-picker { padding: 14px 8px 10px; gap: 10px; }
  .body-fig { max-width: 130px; }
  .body-tag { font-size: 10px; padding: 4px 10px; }
}
