/* Flơr — palette taken from the logo and name card */
:root {
  --cream: #fbf8f1;
  --cream-2: #f4efe6;
  --paper: #fffdf8;
  --rose: #c9908c;
  --rose-deep: #a9706d;
  --rose-soft: #efd9d5;
  --sage: #8c9473;
  --sage-deep: #6c7356;
  --sage-soft: #e3e6d6;
  --ink: #5f634f;
  --line: #e2dccf;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(110, 100, 80, 0.12);
  --serif: "Prata", "Times New Roman", serif;
  --script: "Great Vibes", cursive;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font: 300 16px/1.6 var(--sans);
  overflow-x: hidden;
}
.blossoms {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    url("../assets/blossom.svg") right -120px top -60px / 520px no-repeat,
    url("../assets/blossom.svg") left -160px bottom -140px / 560px no-repeat;
  opacity: 0.09;
}

h1, h2, h3, legend { font-family: var(--serif); font-weight: 400; color: var(--rose-deep); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
}
.brand img { height: 52px; display: block; }
.top-contact { color: var(--sage-deep); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line); }

.view { display: none; max-width: 760px; margin: 0 auto; padding: 8px 20px 40px; animation: fade 0.5s ease; }
.view.active { display: block; }
#result.view { max-width: 1080px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ---------- intro ---------- */
#intro { text-align: center; padding-top: 10px; }
.hero-logo { width: min(340px, 80vw); display: block; margin: 0 auto; }
.slogan { font-family: var(--serif); color: var(--rose); font-size: 22px; line-height: 1.35; margin: 6px 0 26px; }
.slogan span { font-size: 17px; }
#intro h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.3; margin: 0 0 12px; }
#intro h1 em { font-family: var(--script); font-style: normal; font-size: 1.5em; color: var(--rose); }
.lead { max-width: 520px; margin: 0 auto 28px; }
.how { list-style: none; display: flex; gap: 12px; justify-content: center; padding: 0; margin: 34px 0 0; flex-wrap: wrap; }
.how li { font-size: 14px; color: var(--sage-deep); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 6px; }
.how b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sage-soft); margin-right: 8px; font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; font-weight: 400; letter-spacing: 0.02em;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.primary { background: var(--rose); color: #fff; box-shadow: 0 6px 18px rgba(201, 144, 140, 0.35); }
.btn.primary:hover { background: var(--rose-deep); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--sage-deep); }
.btn.ghost:hover { background: var(--paper); }
.btn.zalo { background: var(--sage); color: #fff; }
.btn.zalo:hover { background: var(--sage-deep); }

/* ---------- wizard ---------- */
.progress { display: flex; gap: 6px; margin: 6px 0 20px; }
.progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background 0.3s; }
.progress span.done { background: var(--rose); }

.step { display: none; border: 0; margin: 0; padding: 24px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.step.active { display: block; animation: fade 0.4s ease; }
legend { font-size: 26px; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
legend small { display: block; font: 400 12px var(--sans); letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage); }
legend + * { clear: both; }
.q { display: block; margin: 20px 0 8px; font-weight: 400; color: var(--sage-deep); }
.q small, .hint { color: #9a9c8a; font-size: 13px; }
.hint { margin: 8px 0 0; }
.hint.center { text-align: center; max-width: 560px; margin: 18px auto 0; }
output { font-family: var(--serif); color: var(--rose-deep); margin-left: 6px; }

input:not([type="range"]), select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--cream); outline: none; transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

input[type="range"] {
  --pct: 30%;
  width: 100%; height: 6px; appearance: none; border-radius: 6px; outline: none;
  background: linear-gradient(90deg, var(--rose) var(--pct), var(--line) var(--pct));
}
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--rose); box-shadow: var(--shadow); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--rose); cursor: pointer; }
.range-ticks { display: flex; justify-content: space-between; font-size: 12px; color: #a6a895; margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream);
  cursor: pointer; transition: all 0.15s;
}
.chips.small button { padding: 7px 13px; font-size: 14px; }
.chips button:hover { border-color: var(--rose); }
.chips button.on { background: var(--rose-soft); border-color: var(--rose); color: var(--rose-deep); font-weight: 400; }
#avoidChips button.on { background: var(--sage-soft); border-color: var(--sage); color: var(--sage-deep); text-decoration: line-through; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; background: none; border: 0; cursor: pointer; padding: 4px 0; font-size: 12px; }
.swatches i { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); transition: transform 0.15s, box-shadow 0.15s; }
.swatches i.auto { background: conic-gradient(#e8a7b0, #f2c94c, #b6c98a, #8fb1d6, #a98bc4, #e8a7b0); }
.swatches button.on i { transform: scale(1.08); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--rose); }
.swatches button.on span { color: var(--rose-deep); }

.mbti { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mbti button { padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); cursor: pointer; line-height: 1.2; }
.mbti b { display: block; font-family: var(--serif); font-weight: 400; color: var(--rose-deep); font-size: 15px; }
.mbti small { font-size: 11px; color: #9a9c8a; }
.mbti button.on { background: var(--rose-soft); border-color: var(--rose); }

.zodiac-badge { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--sage-soft); color: var(--sage-deep); font-size: 14px; }
.zodiac-badge b { font-family: var(--serif); font-weight: 400; }

.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- result card ---------- */
.card { background: var(--cream); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.card-head img { height: 54px; }
.card-kicker { margin: 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); }
.card-code { margin: 0; font-family: var(--serif); color: var(--rose-deep); }

.card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 24px; }
.photo { margin: 0; }
.frame { position: relative; }
.photo-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 253, 248, 0.92); color: var(--rose-deep); font-size: 12px; letter-spacing: 0.04em;
}
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs button { flex: 1; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--cream-2); cursor: pointer; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button.on { border-color: var(--rose); }
.thumbs .ai-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--sage-deep); border: 1px dashed var(--sage); }
.thumbs .ai-tile span { font-size: 20px; color: var(--rose); }
.thumbs .ai-tile.on { border: 2px solid var(--rose); }
.frame img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; display: block; background: var(--cream-2); opacity: 0; transition: opacity 0.8s; }
.frame img.ready { opacity: 1; }
.photo figcaption { font-size: 11px; color: #a6a895; margin-top: 8px; text-align: center; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; border-radius: 16px; background: linear-gradient(110deg, var(--cream-2) 30%, var(--paper) 50%, var(--cream-2) 70%) 0 0 / 300% 100%; animation: shimmer 2.4s linear infinite; }
.loading[hidden] { display: none; }
.loading p { margin: 18px 0 0; color: var(--sage-deep); font-size: 14px; padding: 0 16px; }
.loading.error { animation: none; }
.loading.error .petals { display: none; }
@keyframes shimmer { to { background-position: -300% 0; } }
.petals { position: relative; width: 60px; height: 60px; margin: 0 auto; animation: spin 6s linear infinite; }
.petals i { position: absolute; left: 22px; top: 0; width: 16px; height: 30px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: var(--rose); opacity: 0.75; transform-origin: 8px 30px; }
.petals i:nth-child(2) { transform: rotate(72deg); }
.petals i:nth-child(3) { transform: rotate(144deg); }
.petals i:nth-child(4) { transform: rotate(216deg); }
.petals i:nth-child(5) { transform: rotate(288deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.details h3 { font-size: 16px; color: var(--sage-deep); margin: 20px 0 8px; }
.for { margin: 0; font-size: 13px; letter-spacing: 0.06em; color: var(--sage); }
.bq-name { font-family: var(--script); color: var(--rose); font-size: 46px; line-height: 1.15; margin: 2px 0 10px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.palette span { display: inline-flex; align-items: center; gap: 6px; }
.palette i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); }
.recipe, .reasons { list-style: none; padding: 0; margin: 0; }
.recipe li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.recipe li span { flex: 0 0 82px; color: #9a9c8a; font-size: 13px; padding-top: 2px; }
.reasons li { position: relative; padding-left: 20px; margin: 6px 0; font-size: 14px; }
.reasons li::before { content: "✿"; position: absolute; left: 0; color: var(--rose); }
.price-row { display: flex; gap: 12px; margin-top: 16px; }
.price-row > div { flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.price-row span { display: block; font-size: 12px; color: #9a9c8a; }
.price-row b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--rose-deep); }
.wish { margin: 20px 0 0; padding: 14px 18px; border-left: 3px solid var(--rose); background: var(--paper); border-radius: 0 12px 12px 0; font-family: var(--serif); color: var(--rose-deep); }
.meta { font-size: 13px; color: #8f917f; margin: 14px 0 0; }
.meta b { font-weight: 400; color: var(--ink); }
.card-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding: 12px 20px; background: var(--paper); border-top: 1px solid var(--line); font-size: 13px; color: var(--sage-deep); }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.actions.secondary { margin-top: 10px; }
.site-foot { text-align: center; font-size: 12px; color: #a6a895; padding: 20px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .view { padding: 4px 16px 32px; }
  .step { padding: 20px 16px; }
  .card-body { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .bq-name { font-size: 40px; }
  .mbti { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .mbti small { display: none; }
  .swatches button { width: 62px; }
  .actions .btn { flex: 1 1 100%; }
  .top { padding: 10px 16px; }
  .brand img { height: 44px; }
}
@media (max-width: 420px) {
  .grid2 { grid-template-columns: 1fr; }
}
