:root {
  --brand-ink: #151c33;
  --brand-sand: #b9a58a;
  --brand-green: #1fa855;
  --ink: #1d2233;
  --muted: #7d8493;
  --line: #ddd6ca;
  --page: #f6f3ee;
  --card-shadow: 0 3px 12px rgba(40, 32, 20, 0.12);
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-title: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { height: 100%; background: var(--page); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-width: 320px;
  height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
button, .choice-option, .product-option { touch-action: manipulation; }

.landing-shell {
  display: flex;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  justify-content: center;
  background: #fff;
}

.form-experience {
  position: relative;
  display: flex;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 480px;
  flex-direction: column;
  overflow: hidden;
  background: var(--page);
}

.hero-background {
  position: absolute;
  z-index: -2;
  top: 0;
  right: 0;
  left: 0;
  height: 315px;
  background-color: #e6dfd3;
  background-image: linear-gradient(rgba(246, 243, 238, 0.12), rgba(246, 243, 238, 0.12)), url("assets/mistica-lunara-hero.jpg");
  background-position: 64% center;
  background-size: cover;
}

.page-wash {
  position: absolute;
  z-index: -1;
  top: 288px;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--page);
}

.form-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 24px 0;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--brand-ink);
  background: transparent;
  font-size: 39px;
  font-weight: 200;
  line-height: 1;
}

.back-button { font-size: 43px; }
.back-button:disabled { visibility: hidden; }
.close-button { font-size: 36px; }
.icon-button:focus-visible, .primary-button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; }

#order-form {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.form-steps {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.form-step {
  display: none;
  width: 100%;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 34px;
}

.form-step.is-active { display: flex; }
.welcome-step, .success-step { flex-direction: column; justify-content: center; padding-top: 48px; }
.question-step { align-items: flex-start; padding-top: 72px; }
.contact-step { align-items: flex-start; padding-top: 72px; }

.card {
  width: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

/* El logo de Mística Lunara es blanco sobre transparente: se oscurece para leerse sobre fondo claro. */
.brand-badge {
  display: flex;
  height: 64px;
  flex: 0 0 64px;
  margin-bottom: -32px;
  padding: 0 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ece6db;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(40, 32, 20, 0.1);
  z-index: 1;
}

.brand-badge img {
  display: block;
  width: 150px;
  height: auto;
  filter: brightness(0);
}

.welcome-card { padding: 51px 24px 28px; text-align: center; }
.company-name { margin: 0 0 18px; color: var(--muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.welcome-card h1 { margin: 0 0 20px; font-family: var(--font-title); font-size: 26px; line-height: 1.3; color: var(--brand-ink); }
.welcome-card p, .success-card p { margin: 0 0 17px; font-size: 17px; line-height: 1.6; }
.welcome-card .welcome-callout { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid #ece6db; color: var(--brand-ink); font-weight: 500; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { display: block; margin-bottom: 14px; padding: 0; font-family: var(--font-title); font-size: 21px; font-weight: 700; line-height: 1.35; color: var(--brand-ink); }
.question-card { padding: 26px 21px 22px; }
.step-note { margin: -4px 0 16px; padding-left: 12px; border-left: 3px solid var(--brand-sand); color: #5d6372; font-size: 14px; line-height: 1.45; }

.choice-option {
  position: relative;
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 13px 54px 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 19px;
  line-height: 1.18;
}
.choice-option input { position: absolute; opacity: 0; }
.choice-option i { position: absolute; right: 14px; width: 26px; height: 26px; border: 2px solid var(--brand-ink); border-radius: 50%; }
.choice-option input:checked + span + i { border: 8px solid var(--brand-ink); }
.choice-option:has(input:checked) { border-color: var(--brand-ink); background: #faf8f4; }
.choice-option:focus-within { outline: 3px solid var(--brand-ink); outline-offset: 2px; }

/* Selección de producto */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.product-option {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
}
.product-option input { position: absolute; opacity: 0; }
.product-option img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 6px; background: #fff; object-fit: cover; }
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  background: var(--brand-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.product-name { margin-top: 6px; font-family: var(--font-title); font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--brand-ink); }
.product-desc { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.product-price { display: flex; margin-top: auto; padding-top: 8px; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 6px; font-size: 14px; white-space: nowrap; }
.product-price strong { font-size: 17px; color: var(--brand-ink); }
.product-price s { color: var(--muted); font-size: 12px; }
.product-option i {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--brand-ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
}
.product-option input:checked ~ i { border: 8px solid var(--brand-ink); }
.product-option:has(input:checked) { border-color: var(--brand-ink); box-shadow: 0 0 0 1px var(--brand-ink); }
.product-option:focus-within { outline: 3px solid var(--brand-ink); outline-offset: 2px; }

.input-group { margin-top: 22px; }
.input-group label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 15px; }
.input-group input {
  width: 100%;
  padding: 8px 2px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 19px;
  line-height: 1.4;
}
.input-group input::placeholder { color: #a39d92; opacity: 1; }
.input-group select {
  width: 100%;
  padding: 10px 28px 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23151c33' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center / 13px;
  font-size: 19px;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
}
.input-group select:invalid { color: #a39d92; }
.input-group select option { color: var(--ink); }
.input-group select:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; }
.field-hint { margin: 8px 0 0; color: #8b8579; font-size: 13px; line-height: 1.4; }

.quantity-control { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.quantity-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand-ink);
  background: #fff;
  font-size: 26px;
  line-height: 1;
}
.quantity-button:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.quantity-control input { width: 54px; padding: 4px 0; border: 0; color: var(--brand-ink); background: transparent; font-size: 22px; font-weight: 700; text-align: center; }
.quantity-unit { margin-left: auto; color: var(--muted); font-size: 14px; }
.is-invalid { border-color: #c42626 !important; }

.contact-card { padding: 27px 21px 32px; }
.contact-card h2 { margin: 0 0 14px; font-family: var(--font-title); font-size: 22px; font-weight: 700; color: var(--brand-ink); }
.contact-card > p { margin: 0 0 16px; font-size: 16px; line-height: 1.45; }

.order-summary {
  padding: 12px 14px;
  border-radius: 8px;
  background: #faf8f4;
  border: 1px solid #ece6db;
  font-size: 16px;
}
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.summary-row > span:last-child { white-space: nowrap; }
.summary-total { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e6e0d5; font-weight: 700; color: var(--brand-ink); }
.summary-total strong { font-size: 20px; }
.summary-note { margin: 8px 0 0; color: #8b8579; font-size: 12.5px; line-height: 1.35; }

.contact-card .privacy-note { margin: 26px 0 0; color: #8b8579; font-size: 13px; line-height: 1.4; }
.privacy-note a { color: var(--brand-ink); font-weight: 700; text-decoration: underline; }

.success-card { padding: 49px 22px 17px; }
.success-card .company-name { margin-bottom: 14px; text-align: center; }
.success-card h2 { margin: 0 0 15px; font-family: var(--font-title); font-size: 23px; text-align: center; color: var(--brand-ink); }
.success-card p { font-size: 16px; line-height: 1.4; }
.success-card .success-note { margin: 15px 0 0; padding-top: 17px; border-top: 1px solid #e6e0d5; color: #8b8579; font-size: 14px; }
.success-note span { color: #a39d92; }
.google-ads-conversion-slot { display: none; }

.website-button {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-ink);
  font-size: 17px;
  text-align: center;
  text-decoration: none;
}
.whatsapp-button { margin: 4px 0 0; background: var(--brand-green); }
.whatsapp-button:hover { background: #178a45; }

.form-footer {
  position: sticky;
  z-index: 2;
  bottom: 0;
  flex: 0 0 auto;
  padding: 6px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, rgba(246, 243, 238, 0), var(--page) 25%);
}
.form-status { min-height: 21px; margin: 0 2px 4px; color: #b32020; font-size: 14px; line-height: 1.35; text-align: center; }
.form-status:empty { display: none; }
.progress-track { height: 5px; margin: 0 0 11px; overflow: hidden; border-radius: 999px; background: #e6e0d5; }
.progress-track span { display: block; width: 8%; height: 100%; border-radius: inherit; background: var(--brand-sand); transition: width .25s ease; }
.primary-button { display: flex; width: 100%; min-height: 53px; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 8px; color: #fff; background: var(--brand-ink); font-size: 18px; font-weight: 500; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.primary-button .whatsapp-icon { display: none; width: 22px; height: 22px; flex: 0 0 auto; }
.primary-button.is-whatsapp { background: var(--brand-green); }
.primary-button.is-whatsapp:hover { background: #178a45; }
.primary-button.is-whatsapp .whatsapp-icon { display: block; }
.honeypot { position: fixed; left: -10000px; width: 1px; height: 1px; opacity: 0; }

.form-experience.is-finished .form-footer { display: none; }
.form-experience.is-success .form-header { visibility: hidden; }

@media (min-width: 481px) {
  body { background: #ece7de; }

  .landing-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 12px;
    background: #ece7de;
  }

  .landing-shell::before {
    position: absolute;
    z-index: -1;
    inset: -24px;
    content: "";
    background:
      linear-gradient(90deg, rgba(246, 243, 238, .86), rgba(246, 243, 238, .5) 45%, rgba(246, 243, 238, .82)),
      url("assets/mistica-lunara-hero.jpg") center / cover no-repeat;
    filter: blur(11px);
    transform: scale(1.04);
  }

  .form-experience {
    min-height: calc(100vh - 24px);
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 10px;
    box-shadow: 0 22px 58px rgba(40, 32, 20, .26), 0 3px 10px rgba(40, 32, 20, .12);
  }
}

@media (max-height: 800px) {
  .welcome-step { justify-content: flex-start; }
}

@media (max-height: 700px) {
  .form-header { min-height: 56px; }
  .welcome-step { justify-content: flex-start; padding-top: 14px; }
  .success-step { padding-top: 14px; }
  .question-step { padding-top: 26px; }
  .contact-step { padding-top: 16px; }
  .welcome-card p { line-height: 1.45; }
}

@media (max-width: 360px) {
  .product-grid { gap: 8px; }
  .product-name { font-size: 15px; }
}
