/* ================================================================
   Skin Analyzer (Dokter AI Mila) — mengikuti template msglowid.com
   Brand: #F15078, background putih / ivory, kartu putih rounded
   ================================================================ */

.sa-page {
  --sa-brand: #F15078;
  --sa-brand-dark: #d93a63;
  --sa-brand-soft: #fff1f5;
  --sa-ink: #222;
  --sa-muted: #777;
  --sa-line: #f0e6ea;
  --sa-good: #2fae6b;
  --sa-ok: #f2a93b;
  --sa-low: #F15078;
}

.text-brand { color: var(--sa-brand, #F15078) !important; }

/* ---------- Tombol ---------- */
.sa-btn {
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
}
.sa-btn:hover { color: #fff; }
/* brand buttons: style.css `a { color: inherit !important }` turns <a class="btn"> labels invisible, so force white label + pink fill */
.hv1 .sa-page .v1-btn-brand,
.hv1 .sa-page .v1-btn-brand:hover,
.hv1 .sa-page .v1-btn-brand:focus {
  color: #fff !important;
  border-color: var(--brand-primary-hover);
}
.hv1 .sa-page .v1-btn-brand { background: var(--brand-primary-hover); }
.hv1 .sa-page .v1-btn-brand:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
.sa-btn-ghost {
  background: #fff;
  color: var(--sa-ink, #222);
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  font-weight: 600;
}
.sa-btn-ghost:hover { border-color: #F15078; color: #F15078; background: #fff; }
.sa-back { color: var(--sa-muted); font-size: 14px; text-decoration: none; margin-top: 6px; }
.sa-back:hover { color: var(--sa-brand); }

/* ================= INTRO ================= */
.sa-wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}

.sa-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 18px;
}
.sa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--sa-brand), 0 12px 30px rgba(241, 80, 120, .25);
}
.sa-online {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sa-good);
  border: 3px solid #fff;
  animation: saPulse 1.8s infinite;
}
@keyframes saPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 174, 107, .5); }
  50% { box-shadow: 0 0 0 7px rgba(47, 174, 107, 0); }
}

.sa-title span { color: var(--sa-brand); }
.sa-lead { color: var(--sa-muted); font-size: 16px; line-height: 1.6; max-width: 520px; }

.sa-benefits { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.sa-benefits li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--sa-ink); }
.sa-benefits i {
  flex: 0 0 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--sa-brand-soft); color: var(--sa-brand);
}

.sa-last {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px; padding: 12px 16px; max-width: 420px;
  border: 1px dashed var(--sa-brand); border-radius: 14px;
  background: var(--sa-brand-soft); color: var(--sa-ink);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.sa-last:hover { color: var(--sa-brand); }
.sa-last[hidden] { display: none; }
.sa-last small { color: var(--sa-muted); font-weight: 400; }

/* ---------- Kartu form ---------- */
.sa-card {
  background: #fff;
  border: 1px solid var(--sa-line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(241, 80, 120, .08);
}

.sa-steps {
  display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px;
  font-size: 12px; font-weight: 600; color: #aaa;
}
.sa-steps li { flex: 1; display: flex; align-items: center; gap: 6px; padding-bottom: 10px; border-bottom: 3px solid #f1f1f1; }
.sa-steps li span {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f1f1; color: #999; font-size: 11px;
}
.sa-steps li.is-active { color: var(--sa-ink); border-bottom-color: var(--sa-brand); }
.sa-steps li.is-active span { background: var(--sa-brand); color: #fff; }

.sa-step { display: none; }
.sa-step.is-active { display: block; animation: saFade .3s ease; }
@keyframes saFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sa-step-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.sa-input { padding: 12px 14px; border-radius: 12px; }
.sa-input:focus { border-color: var(--sa-brand); box-shadow: 0 0 0 .2rem rgba(241, 80, 120, .15); }
.sa-page .input-group-text { border-radius: 0 12px 12px 0; background: #fafafa; }
.sa-page .input-group .sa-input { border-radius: 12px 0 0 12px; }

.sa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-chip {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid #e3e3e3; background: #fff;
  font-size: 13px; font-weight: 600; color: #555;
  transition: all .15s;
}
.sa-chip:hover { border-color: var(--sa-brand); color: var(--sa-brand); }
.sa-chip.is-active { background: var(--sa-brand-soft); border-color: var(--sa-brand); color: var(--sa-brand); }
.sa-chip.is-static { cursor: default; padding: 4px 12px; font-size: 12px; }

.sa-consent .form-check-input:checked { background-color: var(--sa-brand); border-color: var(--sa-brand); }
.sa-consent .form-check-label { color: var(--sa-muted); line-height: 1.5; }

.sa-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.sa-tip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px; border-radius: 16px; background: #fafafa; font-size: 13px;
}
.sa-tip i { font-size: 22px; color: var(--sa-brand); margin-bottom: 4px; }
.sa-tip span { color: var(--sa-muted); font-size: 12px; line-height: 1.4; }

.sa-secure {
  margin-top: 18px; text-align: center;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #aaa;
}
.sa-secure i { color: var(--sa-brand); }

/* ---------- Cara kerja ---------- */
.sa-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sa-how-item {
  position: relative; text-align: center;
  padding: 28px 20px 22px; border-radius: 20px; background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}
.sa-how-item span {
  position: absolute; top: 14px; left: 16px;
  font-weight: 800; font-size: 13px; color: var(--sa-brand); opacity: .6;
}
.sa-how-item i { font-size: 32px; color: var(--sa-brand); display: block; margin-bottom: 8px; }
.sa-how-item b { display: block; margin-bottom: 4px; }
.sa-how-item p { margin: 0; color: var(--sa-muted); font-size: 14px; }

/* ================= SCANNER & LOADING ================= */
.sa-scanner {
  position: fixed; inset: 0; z-index: 10050;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sa-scanner[hidden] { display: none; }
.sa-scanner-head {
  position: absolute; top: 18px; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
}
.sa-scanner-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid #F15078; }

#YMK-module {
  position: relative;
  width: 100vw !important; max-width: 420px !important; height: 75vh !important;
  margin: 0 auto; background: #000;
  border-radius: 0 0 32px 32px !important; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#YMK-module video, #YMK-module canvas { width: 100% !important; height: 100% !important; object-fit: contain !important; }

.sa-scanner-cancel {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 8px 30px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8); backdrop-filter: blur(6px);
}

.sa-loading {
  position: fixed; inset: 0; z-index: 10060;
  background: rgba(255, 255, 255, .96);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.sa-loading[hidden] { display: none; }
.sa-loading-avatar {
  width: 96px; height: 96px; border-radius: 50%; padding: 4px;
  background: conic-gradient(#F15078, #ffd1de, #F15078);
  animation: saSpin 1.6s linear infinite;
}
.sa-loading-avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: top;
  border: 3px solid #fff; animation: saSpin 1.6s linear infinite reverse;
}
@keyframes saSpin { to { transform: rotate(360deg); } }
.sa-loading-text { margin: 18px 0 12px; font-weight: 700; color: #222; }
.sa-loading-bar { width: 180px; height: 4px; border-radius: 4px; background: #f3d6de; overflow: hidden; }
.sa-loading-bar span { display: block; width: 40%; height: 100%; background: #F15078; border-radius: 4px; animation: saBar 1.2s ease-in-out infinite; }
@keyframes saBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- Modal pertanyaan ---------- */
.sa-q { border: 0; border-radius: 24px; padding: 28px 24px 24px; text-align: center; }
.sa-q-avatar {
  width: 64px; height: 64px; margin: -60px auto 10px; border-radius: 50%;
  object-fit: cover; object-position: top; border: 3px solid #fff; box-shadow: 0 0 0 3px #F15078;
}
.sa-q-title { font-weight: 800; margin-bottom: 6px; }
.sa-q-text { color: #777; font-size: 14px; margin-bottom: 18px; }
.sa-q-options { display: grid; gap: 10px; }

/* ================= HASIL ================= */
.sa-res-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.sa-res-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top;
  border: 3px solid #fff; box-shadow: 0 0 0 3px var(--sa-brand);
}
.sa-res-title { margin-bottom: 4px; }
.sa-res-meta { font-size: 13px; color: var(--sa-muted); }
.sa-res-actions { display: flex; gap: 8px; }

.sa-res-grid { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }

.sa-photo {
  position: relative; aspect-ratio: 3 / 4;
  border-radius: 24px; overflow: hidden; background: #f6eef1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .08);
}
.sa-photo > img { width: 100%; height: 100%; object-fit: cover; }
.sa-photo-private {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #b9a3ab; font-size: 13px; text-align: center; padding: 20px;
}
.sa-photo-private i { font-size: 40px; }

.sa-overall {
  position: absolute; right: 14px; bottom: 14px;
  width: 104px; height: 104px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.sa-overall svg { position: absolute; inset: 8px; transform: rotate(-90deg); }
.sa-overall circle { fill: none; stroke-width: 3.2; }
.sa-overall .bg { stroke: #f2f2f2; }
.sa-overall .fg { stroke-linecap: round; stroke: var(--sa-brand); }
.sa-overall--good .fg { stroke: var(--sa-good); }
.sa-overall--ok .fg { stroke: var(--sa-ok); }
.sa-overall-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.sa-overall-num b { font-size: 28px; font-weight: 800; }
.sa-overall-num small { font-size: 10px; color: var(--sa-muted); margin-top: 3px; }

.sa-grade {
  margin-top: 14px; text-align: center; font-weight: 800; font-size: 15px;
  padding: 8px; border-radius: 12px;
}
.sa-grade--good { color: var(--sa-good); background: #e9f8f0; }
.sa-grade--ok { color: #c7841c; background: #fff5e4; }
.sa-grade--low { color: var(--sa-brand); background: var(--sa-brand-soft); }

.sa-concerns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--sa-muted); }

.sa-panel {
  background: #fff; border: 1px solid var(--sa-line); border-radius: 24px; padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .04);
}
.sa-panel-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.sa-radar { position: relative; height: 280px; margin-bottom: 12px; }

.sa-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.sa-metric-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.sa-metric-head i { color: var(--sa-brand); margin-right: 4px; }
.sa-bar { height: 8px; border-radius: 8px; background: #f3f3f3; overflow: hidden; }
.sa-bar span { display: block; height: 100%; border-radius: 8px; transition: width 1s ease; }
.sa-bar--good { background: var(--sa-good); }
.sa-bar--ok { background: var(--sa-ok); }
.sa-bar--low { background: var(--sa-low); }
.sa-lvl--good { color: var(--sa-good); }
.sa-lvl--ok { color: #c7841c; }
.sa-lvl--low { color: var(--sa-low); }
.sa-metric-tip { margin: 6px 0 0; font-size: 12px; color: var(--sa-muted); line-height: 1.45; }
.sa-metric-tip i { color: var(--sa-ok); }

.sa-conclusion {
  display: flex; gap: 16px; align-items: flex-start;
  margin-top: 28px; padding: 22px; border-radius: 24px;
  background: var(--sa-brand-soft); border: 1px solid #ffd9e3;
}
.sa-conclusion img {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; object-position: top; border: 2px solid var(--sa-brand);
}
.sa-conclusion p { font-size: 15px; line-height: 1.6; }
.sa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  background: var(--sa-brand); color: #fff; font-weight: 700; font-size: 13px;
}

/* ---------- Produk ---------- */
.sa-bundle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 8px;
  border-radius: 18px; background: #fff; border: 1px solid var(--sa-line);
}
.sa-bundle[hidden] { display: none; }
.sa-bundle-save {
  display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 6px;
  background: #e9f8f0; color: var(--sa-good); font-weight: 700; font-size: 12px;
}

.sa-products {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 16px 0 8px;
}
.sa-products .prod-card { position: relative; }
.sa-pick {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 10px; border-radius: 999px;
  background: #222; color: #fff; font-size: 11px; font-weight: 700;
}
.sa-fallback { color: inherit; text-decoration: none; display: block; }
.sa-fallback-cta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--sa-brand); }

.sa-reminder {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 28px; padding: 18px 20px; border-radius: 18px; background: #fff;
  border: 1px dashed var(--sa-brand);
}
.sa-reminder > i { font-size: 28px; color: var(--sa-brand); }

.sa-disclaimer { margin: 18px 0 0; font-size: 12px; color: #999; line-height: 1.6; text-align: center; }

/* ================= RESPONSIVE ================= */
@media (max-width: 991.98px) {
  .sa-wrap { grid-template-columns: 1fr; gap: 28px; }
  .sa-res-grid { grid-template-columns: 1fr; }
  .sa-res-left { max-width: 380px; margin: 0 auto; width: 100%; }
  .sa-products { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 575.98px) {
  .sa-card { padding: 20px; border-radius: 20px; }
  .sa-steps { font-size: 11px; }
  .sa-how { grid-template-columns: 1fr; }
  .sa-metrics { grid-template-columns: 1fr; }
  .sa-products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .sa-res-actions { width: 100%; }
  .sa-res-actions .btn { flex: 1; }
  .sa-bundle .btn { width: 100%; }
  .sa-radar { height: 240px; }
}
