@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/InterDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Bảng màu lấy theo bộ Core 2 */
:root {
  --bg: #f1f1f1;
  --card: #fdfdfd;
  --soft: #f6f6f6;
  --text: #101010;
  --muted: #727272;
  --line: #e2e2e2;
  --line-hover: rgba(123, 123, 123, .5);
  --dark: #191919;

  --green: #00a656;
  --red: #ff381c;
  --orange: #ff9d34;
  --purple: #7f5fff;
  --blue: #2a85ff;
  --pink: #f52495;

  --p-green: #b5e4ca;
  --p-orange: #ffbc99;
  --p-purple: #cabdff;
  --p-blue: #b1e5fc;
  --p-yellow: #ffd88d;
  --p-pink: #ffc4e3;

  --shadow-widget: 0 5px 1.5px -4px rgba(8, 8, 8, .09), 0 6px 4px -4px rgba(8, 8, 8, .05);
  --shadow-depth: 0 2.15px .5px -2px rgba(0, 0, 0, .25), 0 24px 24px -16px rgba(8, 8, 8, .04), 0 6px 13px 0 rgba(8, 8, 8, .03), 0 6px 4px -4px rgba(8, 8, 8, .05), 0 5px 1.5px -4px rgba(8, 8, 8, .09);
  --shadow-typing: inset 0 4px 4px rgba(157, 157, 157, .1), inset 0 0 0 3px #fff;
  --font: "Inter Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010;
    --card: #191919;
    --soft: #202020;
    --text: #f1f1f1;
    --muted: #8a8a8a;
    --line: #2a2a2a;
    --line-hover: rgba(114, 114, 114, .6);
    --dark: #f1f1f1;
    --shadow-widget: inset 0 0 0 1.5px rgba(229, 229, 229, .04), 0 5px 1.5px -4px rgba(8, 8, 8, .5);
    --shadow-depth: 0 6px 13px rgba(8, 8, 8, .3), inset 2px 4px 16px rgba(253, 253, 253, .05);
    --shadow-typing: inset 0 4px 4px rgba(18, 18, 18, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  letter-spacing: -.015em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 26px; border: 0; border-radius: 24px;
  font: 600 14px var(--font); letter-spacing: -.015em; cursor: pointer; transition: all .2s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-sm { height: 40px; padding: 0 18px; }
.btn-black {
  position: relative; color: #fdfdfd;
  background: linear-gradient(to bottom, #2c2c2c, #282828);
  box-shadow: inset 2px 0 8px 2px rgba(248, 248, 248, .2);
}
.btn-black:hover { box-shadow: none; }
.btn-stroke { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-stroke:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-hover); }
@media (prefers-color-scheme: dark) {
  .btn-black { background: linear-gradient(to bottom, #fdfdfd, #dedede); color: #101010; box-shadow: none; }
}

/* ---------- header ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 88px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.logo { width: 40px; height: 40px; }

/* ---------- card ---------- */
.card { padding: 24px; border-radius: 32px; background: var(--card); box-shadow: var(--shadow-widget); }
.card-title { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.marker { width: 12px; height: 28px; border-radius: 4px; flex: none; }
.marker-green { background: var(--p-green); }
.marker-orange { background: var(--p-orange); }
.marker-purple { background: var(--p-purple); }
.marker-blue { background: var(--p-blue); }
.marker-yellow { background: var(--p-yellow); }
.marker-pink { background: var(--p-pink); }

/* ---------- bố cục ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; align-items: start; }
.intro { display: grid; gap: 12px; position: sticky; top: 12px; }

.hero {
  position: relative; overflow: hidden; padding: 32px; color: #fdfdfd;
  background:
    radial-gradient(280px 200px at 100% 0%, rgba(202, 189, 255, .45), transparent 70%),
    radial-gradient(260px 220px at 0% 100%, rgba(181, 228, 202, .35), transparent 70%),
    radial-gradient(200px 160px at 90% 100%, rgba(255, 188, 153, .35), transparent 70%),
    #191919;
}
@media (prefers-color-scheme: dark) { .hero { background-color: #222; } }
.chip-soft {
  display: inline-flex; height: 28px; align-items: center; padding: 0 12px; margin-bottom: 20px;
  border-radius: 14px; background: rgba(253, 253, 253, .1); font-size: 12px; font-weight: 600;
}
.hero h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.hl-green { color: var(--p-green); }
.hl-orange { color: var(--p-orange); }
.hl-purple { color: var(--p-purple); }
.hero > p { margin: 16px 0 24px; color: rgba(253, 253, 253, .7); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hero-tags li { padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #101010; }
.tag-green { background: var(--p-green); }
.tag-purple { background: var(--p-purple); }
.tag-yellow { background: var(--p-yellow); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps b { font-weight: 600; }
.steps p { color: var(--muted); font-size: 14px; }
.step-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none; }
.step-icon svg { width: 22px; height: 22px; fill: none; stroke: #101010; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bg-green { background: var(--p-green); }
.bg-purple { background: var(--p-purple); }
.bg-orange { background: var(--p-orange); }
.bg-yellow { background: var(--p-yellow); }
.safety { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.safety p { color: var(--muted); }
.safety b { color: var(--text); }

/* ---------- form ---------- */
.form-card { padding: 28px; }
#order-form { display: grid; gap: 24px; }
#order-form .card-title { margin-bottom: 0; }
.group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
.group-title { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 15px; font-weight: 600; }
.group-title .marker { width: 8px; height: 18px; border-radius: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: grid; gap: 8px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; }
.field-label i { font-style: normal; font-weight: 500; color: var(--muted); }
input, textarea {
  width: 100%; min-width: 0; height: 48px; padding: 0 18px;
  background: transparent; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 24px;
  font: 500 14px var(--font); letter-spacing: -.015em;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { height: auto; padding: 14px 18px; resize: vertical; }
input:hover, textarea:hover { border-color: var(--line-hover); }
input:focus, textarea:focus { border-color: var(--line-hover); box-shadow: var(--shadow-typing); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .6; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 76px; }
.input-wrap .suffix {
  position: absolute; right: 6px; height: 36px; padding: 0 12px; display: flex; align-items: center;
  border-radius: 18px; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); pointer-events: none;
}
.input-wrap .prefix { position: absolute; left: 18px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-wrap .prefix + input { padding-left: 36px; padding-right: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Ô Mua / Bán */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: 24px; background: var(--soft); cursor: pointer; transition: all .2s;
  box-shadow: inset 0 0 0 1.5px transparent;
}
.side:hover { box-shadow: inset 0 0 0 1.5px var(--line); }
.side input, .coin input, .pay input { position: absolute; opacity: 0; pointer-events: none; }
.side-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card); transition: all .2s; }
.side-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.side-text { display: grid; }
.side-text b { font-weight: 600; }
.side-text small { font-size: 12px; color: var(--muted); }
.side-buy:has(input:checked) { background: linear-gradient(135deg, var(--p-green), #e4f6ec); box-shadow: inset 0 0 0 1.5px rgba(0, 166, 86, .35); color: #101010; }
.side-sell:has(input:checked) { background: linear-gradient(135deg, var(--p-orange), #ffe9dc); box-shadow: inset 0 0 0 1.5px rgba(255, 56, 28, .3); color: #101010; }
.side:has(input:checked) small { color: rgba(16, 16, 16, .6); }
.side-buy:has(input:checked) .side-icon { background: var(--green); }
.side-sell:has(input:checked) .side-icon { background: var(--red); }
.side:has(input:checked) .side-icon svg { stroke: #fff; }
.side:has(input:focus-visible), .coin:has(input:focus-visible), .pay:has(input:focus-visible), .check:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Chip coin: mỗi coin một màu */
.coins, .pays { display: flex; flex-wrap: wrap; gap: 8px; }
.coin, .pay {
  --c: var(--muted);
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 6px;
  border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; user-select: none;
}
.coin:hover, .pay:hover { box-shadow: inset 0 0 0 1.5px var(--line-hover); }
.coin-badge, .pay-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 15px; font-weight: 700;
}
.pay-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.coin:has(input:checked), .pay:has(input:checked) {
  background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 60%, transparent);
}
.c-usdt { --c: #26a17b; }
.c-btc { --c: #f7931a; }
.c-eth { --c: #627eea; }
.c-bnb { --c: #e3a90b; }
.c-other { --c: #7b7b7b; }
.p-bank { --c: var(--blue); }
.p-momo { --c: #d82d8b; }
.p-zalopay { --c: #0068ff; }
.p-cash { --c: var(--green); }
.pay:has(input:checked)::after {
  content: ""; width: 6px; height: 10px; margin-left: 2px; margin-top: -3px;
  border: solid var(--c); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Tóm tắt đổi màu theo Mua / Bán */
.summary { padding: 16px 20px; border-radius: 20px; font-size: 14px; }
.summary:empty { display: none; }
.summary b { font-weight: 700; }
.summary small { display: block; margin-top: 2px; color: var(--muted); }
[data-side="buy"] .summary { background: color-mix(in srgb, var(--p-green) 35%, transparent); }
[data-side="sell"] .summary { background: color-mix(in srgb, var(--p-orange) 35%, transparent); }

.check { position: relative; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  box-shadow: inset 0 0 0 1.5px var(--line-hover); transition: all .2s;
}
.check-box svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.check input:checked + .check-box { background: var(--purple); box-shadow: none; }
.check input:checked + .check-box svg { opacity: 1; }

.form-error { padding: 12px 16px; border-radius: 16px; background: rgba(255, 56, 28, .08); color: var(--red); font-size: 14px; font-weight: 500; }
.form-error:empty { display: none; }

.btn-submit { width: 100%; height: 56px; border-radius: 28px; color: #fff; font-size: 16px; }
[data-side="buy"] .btn-submit { background: linear-gradient(135deg, #00b862, #00924b); box-shadow: 0 10px 24px -10px rgba(0, 166, 86, .7); }
[data-side="sell"] .btn-submit { background: linear-gradient(135deg, #ff7a3d, #ff381c); box-shadow: 0 10px 24px -10px rgba(255, 56, 28, .65); }
.btn-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .6; cursor: wait; transform: none; }

/* ---------- thành công ---------- */
.success { display: grid; justify-items: center; gap: 8px; padding: 40px 12px; text-align: center; }
.success-ring {
  display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 12px; border-radius: 50%;
  background: conic-gradient(var(--p-green), var(--p-blue), var(--p-purple), var(--p-orange), var(--p-yellow), var(--p-green));
}
.success-ring svg {
  width: 64px; height: 64px; padding: 16px; border-radius: 50%; background: var(--green);
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.success h2 { font-size: 24px; font-weight: 600; }
.code { font: 700 26px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; padding: 8px 18px; border-radius: 16px; background: var(--soft); }
.success-text { max-width: 30em; margin: 8px 0 16px; font-size: 14px; }
.success-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- FAQ & footer ---------- */
.faq-wrap { margin-top: 12px; }
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
details { border-bottom: 1.5px solid var(--line); }
summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); color: var(--muted); flex: none; }
details[open] summary::after { content: "−"; }
details p { padding: 0 0 16px; color: var(--muted); font-size: 14px; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 28px; padding-bottom: 28px; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }
  .intro { display: contents; }
  .form-card { order: 1; }
  .intro > .card:not(.hero) { order: 2; }
  .faq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .center { padding: 0 12px; }
  .header { height: 72px; }
  .header .btn span { display: none; }
  .header .btn { width: 40px; padding: 0; }
  .card, .form-card { padding: 20px 16px; border-radius: 24px; }
  .hero { padding: 24px 20px; }
  .sides { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
