/*
 * AI Skin Routine Finder — frontend.
 * Lavender/purple skincare-app styling for the shortcode form, the analyzing
 * state, and the result screen. Self-contained: no CDN, no webfonts.
 */

.lasa-stage {
  --lasa-purple: #5b21b6;
  --lasa-purple-2: #7c3aed;
  --lasa-purple-soft: #f3ecfd;
  --lasa-ink: #1e1233;
  --lasa-ink-2: #4b4058;
  --lasa-muted: #7c7389;
  --lasa-line: #e9e0f5;
  --lasa-card: #fff;
  --lasa-ok: #16a34a;

  max-width: 420px;
  margin: 28px auto;
  padding: 0 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--lasa-ink);
  -webkit-font-smoothing: antialiased;
}

.lasa-stage *,
.lasa-stage *::before,
.lasa-stage *::after { box-sizing: border-box; }

/* Themes style headings and buttons aggressively; keep the card self-contained
   so the plugin looks the same whatever theme is active. */
.lasa-stage h2,
.lasa-stage h3,
.lasa-stage h4 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  padding: 0;
}
.lasa-stage p,
.lasa-stage ul,
.lasa-stage li { font-family: inherit; }
.lasa-stage a { box-shadow: none; }
.lasa-stage button { font-family: inherit; }

/* The card is the positioning context for the analyzing overlay. */
.lasa-card-stage {
  position: relative;
  background: var(--lasa-card);
  border: 1px solid var(--lasa-line);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(70, 36, 116, .13);
  overflow: hidden;
}

.lasa-screen { padding: 32px 26px 30px; }

/* ------------------------------------------------------------- typography */

.lasa-screen-head { text-align: center; margin-bottom: 26px; }

.lasa-stage .lasa-title {
  font-family: Georgia, "Times New Roman", "Iowan Old Style", serif;
  font-size: 32px;
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  color: var(--lasa-ink);
  font-weight: 400;
  text-align: center;
}

.lasa-stage .lasa-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--lasa-muted);
  margin: 0;
  text-align: center;
}

.lasa-stage .lasa-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--lasa-ink);
  margin: 24px 0 12px;
}

.lasa-stage .lasa-icon { width: 100%; height: 100%; display: block; }

.lasa-stage .screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ form */

.lasa-field { margin-bottom: 15px; }

.lasa-field > label,
.lasa-field-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--lasa-ink-2);
  margin-bottom: 7px;
}

.lasa-form input[type="text"],
.lasa-form input[type="email"],
.lasa-form input[type="tel"] {
  width: 100%;
  height: 46px;
  border: 1px solid #e2d9ee;
  border-radius: 11px;
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--lasa-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.lasa-form input::placeholder { color: #a79db5; }

.lasa-form input[type="text"]:focus,
.lasa-form input[type="email"]:focus,
.lasa-form input[type="tel"]:focus {
  outline: none;
  border-color: var(--lasa-purple-2);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .14);
}

/* ---------------------------------------------------------------- upload */

.lasa-upload {
  position: relative;
  min-height: 168px;
  border: 1.5px dashed #c9b3ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdfbff, #f8f3fe);
  padding: 18px 18px 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease;
}

.lasa-upload.has-file { border-color: var(--lasa-purple-2); border-style: solid; background: #faf6ff; }

/* Sized for the built-in portrait drawing, but tolerant of whatever artwork is
   dropped in: a landscape asset fills the width instead of shrinking to fit a
   portrait box. */
.lasa-upload-art {
  width: 100%;
  max-width: 150px;
  height: 112px;
  color: #b79ae0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lasa-upload-art > svg { width: auto; height: 100%; }

.lasa-upload-hint {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--lasa-muted);
  text-align: center;
  max-width: 90%;
  overflow-wrap: anywhere;
}

.lasa-upload.has-file .lasa-upload-hint { color: var(--lasa-purple); font-weight: 650; }

/* Circular action buttons pinned to the bottom-right of the panel. */
.lasa-upload-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7c3aed, #5b21b6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(91, 33, 182, .3);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .15s ease;
}

.lasa-upload-btn > .lasa-icon { width: 21px; height: 21px; }
.lasa-upload-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(91, 33, 182, .36); }
.lasa-upload-btn:active { transform: translateY(0); }

.lasa-upload-btn-alt {
  right: 64px;
  background: #f1e8fd;
  color: var(--lasa-purple);
  box-shadow: none;
  border: 1px solid #ddc9f6;
}

.lasa-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.lasa-upload-btn:focus-within {
  outline: 2px solid var(--lasa-purple-2);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- consent */

.lasa-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--lasa-ink-2);
  cursor: pointer;
}

.lasa-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--lasa-purple);
  cursor: pointer;
}

.lasa-privacy {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--lasa-purple-soft);
  border-radius: 13px;
  padding: 13px 14px;
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--lasa-ink-2);
}

.lasa-privacy strong { color: var(--lasa-ink); font-weight: 700; }

.lasa-privacy-icon {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--lasa-purple);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}

/* --------------------------------------------------------------- buttons */

.lasa-btn-primary,
.lasa-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}

.lasa-btn-primary {
  background: linear-gradient(180deg, #7c3aed, #5b21b6);
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(91, 33, 182, .26);
}

.lasa-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(91, 33, 182, .32); }
.lasa-btn-primary:active { transform: translateY(0); }
.lasa-btn-primary[disabled], .lasa-btn-primary.is-busy { opacity: .6; cursor: progress; transform: none; }

.lasa-btn-outline {
  background: #fff;
  color: var(--lasa-ink) !important;
  border: 1px solid #ded3ee;
  margin-top: 10px;
  box-shadow: none;
}

.lasa-btn-outline:hover { background: #faf7fe; }
.lasa-btn-outline .lasa-icon { width: 18px; height: 18px; color: var(--lasa-purple); }

/* ------------------------------------------------------------- analyzing */

.lasa-analyzing {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 5;
  overflow-y: auto;
  animation: lasa-fade .25s ease both;
}

@keyframes lasa-fade { from { opacity: 0; } to { opacity: 1; } }

.lasa-analyzing-screen { text-align: center; }

.lasa-orb {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 26px auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lasa-orb-ring,
.lasa-orb-ring-2 {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 46%, #efe3ff 66%, rgba(124, 58, 237, .1) 100%);
  box-shadow: 0 0 46px rgba(124, 58, 237, .28), inset 0 0 0 1px #e7d7ff;
  animation: lasa-pulse 2.4s ease-in-out infinite;
}

.lasa-orb-ring-2 {
  inset: 16px;
  background: none;
  box-shadow: inset 0 0 0 1.5px rgba(124, 58, 237, .22);
  animation-delay: .6s;
}

@keyframes lasa-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.045); opacity: .88; }
}

.lasa-orb-face {
  position: relative;
  width: 104px;
  height: 122px;
  color: var(--lasa-purple-2);
}

.lasa-steps {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}

.lasa-step {
  display: flex;
  gap: 11px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--lasa-muted);
  transition: color .2s ease;
}

.lasa-step-mark {
  width: 24px; height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ece4f7;
  color: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
  transition: background .25s ease, color .25s ease;
}

.lasa-step.is-active { color: var(--lasa-ink-2); }
.lasa-step.is-active .lasa-step-mark {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--lasa-purple-2);
  animation: lasa-spin 1s linear infinite;
}

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

.lasa-step.is-done { color: var(--lasa-ink); }
.lasa-step.is-done .lasa-step-mark {
  background: var(--lasa-purple);
  color: #fff;
  animation: none;
}

.lasa-tip {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  text-align: left;
  background: var(--lasa-purple-soft);
  border-radius: 13px;
  padding: 13px 14px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--lasa-ink-2);
}

.lasa-tip strong { color: var(--lasa-ink); }
.lasa-tip-icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--lasa-purple-2); }

/* ---------------------------------------------------------------- result */

.lasa-scores { display: grid; gap: 10px; }

.lasa-score {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--lasa-line);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 5px 16px rgba(38, 16, 67, .045);
}

.lasa-score-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--lasa-purple-soft);
  color: var(--lasa-purple);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}

.lasa-score-body strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--lasa-ink);
  margin-bottom: 8px;
}

.lasa-meter {
  display: block;
  height: 6px;
  background: #eee9f5;
  border-radius: 999px;
  overflow: hidden;
}

.lasa-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d28d9, #a855f7);
}

.lasa-score-value { text-align: right; line-height: 1.05; }
.lasa-score-value b { font-size: 21px; font-weight: 700; color: var(--lasa-ink); }
.lasa-score-value small { display: block; font-size: 10px; color: var(--lasa-muted); }

.lasa-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.lasa-product {
  background: #faf7fe;
  border: 1px solid var(--lasa-line);
  border-radius: 14px;
  padding: 11px 10px 12px;
  text-align: center;
}

.lasa-product-img {
  height: 78px;
  border-radius: 11px;
  background: linear-gradient(160deg, #fff, #f1e8fb);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  color: #9f7ad4;
  overflow: hidden;
}

.lasa-product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lasa-product-art { width: 46px; height: 52px; }

.lasa-product h4 {
  font-size: 11.5px;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--lasa-ink);
  font-weight: 700;
}

.lasa-product small {
  display: block;
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--lasa-muted);
  font-weight: 600;
}

.lasa-disclaimer {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--lasa-muted);
  text-align: left;
}

.lasa-disclaimer-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--lasa-ok); }

/* retry state */
.lasa-result .lasa-retry-art {
  width: 62px; height: 62px;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: #fdf3e2;
  color: #b45309;
  display: flex; align-items: center; justify-content: center;
  padding: 15px;
}

.lasa-retry-list {
  margin: 16px 0 18px;
  padding: 14px 16px 14px 32px;
  background: #fdf7ee;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #7c5312;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 430px) {
  .lasa-stage { margin: 14px auto; padding: 0 10px; }
  .lasa-card-stage { border-radius: 22px; }
  .lasa-screen { padding: 26px 18px 24px; }
  .lasa-title { font-size: 28px; }
  .lasa-orb { width: 160px; height: 160px; }
  .lasa-orb-face { width: 88px; height: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .lasa-orb-ring, .lasa-orb-ring-2, .lasa-step.is-active .lasa-step-mark { animation: none; }
  .lasa-btn-primary:hover, .lasa-upload-btn:hover { transform: none; }
}

/* expired-result notice on the form */
.lasa-tip-warn {
  background: #fdf3e2;
  color: #7c5312;
  margin-bottom: 18px;
}
.lasa-tip-warn .lasa-tip-icon { color: #b45309; }

/* Mock-mode cheat sheet, rendered for administrators only. */
.lasa-demo-hint {
  margin: 4px 0 14px;
  padding: 11px 13px;
  border: 1px dashed #cbb6ea;
  border-radius: 11px;
  background: #fbf8ff;
  font-size: 11px;
  line-height: 1.6;
  color: var(--lasa-muted);
}
.lasa-demo-hint strong { color: var(--lasa-purple); }
.lasa-demo-hint code {
  background: #efe6fb;
  color: #5b21b6;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
}

/* --------------------------------------------------- expandable evidence */

.lasa-score {
  display: block;
  padding: 0;
  overflow: hidden;
}

.lasa-score-head {
  display: grid;
  grid-template-columns: 42px 1fr auto 16px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lasa-score-head::-webkit-details-marker { display: none; }
.lasa-score-head:hover { background: #fdfbff; }

.lasa-score-caret {
  width: 9px; height: 9px;
  border-right: 2px solid #b9abd0;
  border-bottom: 2px solid #b9abd0;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
.lasa-score[open] .lasa-score-caret { transform: rotate(-135deg) translate(-3px, -3px); }

.lasa-scores-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--lasa-muted);
  text-align: center;
}

.lasa-evidence {
  border-top: 1px solid var(--lasa-line);
  padding: 14px;
  background: #fdfcff;
  display: grid;
  gap: 14px;
}

.lasa-evidence-band { display: flex; align-items: center; gap: 9px; margin: 0; flex-wrap: wrap; }
.lasa-badge-band {
  background: var(--lasa-purple);
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 750;
}
.lasa-evidence-range { font-size: 11.5px; color: var(--lasa-muted); }

.lasa-evidence-block h5 {
  margin: 0 0 5px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--lasa-muted);
}
.lasa-evidence-block p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--lasa-ink-2); }
.lasa-evidence-hint { margin-top: 5px !important; font-size: 11px !important; color: var(--lasa-muted) !important; }

.lasa-evidence-map { display: grid; grid-template-columns: 124px 1fr; gap: 13px; align-items: start; }

.lasa-facemap-wrap {
  --lasa-facemap-skin: #fbf3ee;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--lasa-line);
  color: #c8b4e4;
}
/* With the viewer's own photo behind, the diagram sits over it at low contrast. */
.lasa-facemap-wrap.has-photo { --lasa-facemap-skin: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .75); }
.lasa-facemap-wrap.has-photo::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(38, 16, 67, .28);
}

.lasa-facemap { position: relative; display: block; width: 100%; height: auto; }

.lasa-zone { fill: rgba(124, 58, 237, .07); transition: fill .2s ease; }
.lasa-zone.is-active { fill: rgba(124, 58, 237, .42); }
.lasa-facemap-wrap.has-photo .lasa-zone { fill: rgba(255, 255, 255, .07); }
.lasa-facemap-wrap.has-photo .lasa-zone.is-active { fill: rgba(167, 106, 255, .55); }

.lasa-zone-list { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }

/* Chips live in the admin stylesheet too; the frontend needs its own. */
.lasa-stage .lasa-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--lasa-purple-soft);
  color: var(--lasa-purple);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.lasa-zone-note {
  flex: 1 0 100%;
  margin: 6px 0 0 !important;
  font-size: 10.5px !important;
  line-height: 1.45;
  color: var(--lasa-muted) !important;
}

.lasa-confidence { display: flex; align-items: center; gap: 10px; }
.lasa-confidence b { font-size: 12px; color: var(--lasa-ink); }
.lasa-meter-soft { flex: 1; }
.lasa-meter-soft > span { background: linear-gradient(90deg, #8b5cf6, #c4a3f7); }

.lasa-evidence-simulated {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdf3e2;
  color: #7c5312;
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 400px) {
  .lasa-evidence-map { grid-template-columns: 96px 1fr; gap: 10px; }
}
/* contain keeps any aspect ratio intact; the box gives it room either way. */
.lasa-upload-art img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
