/* Trang chủ, đăng nhập, điều khoản. Dùng chung token với app.css. */
.topbar { position: absolute; inset: 0 0 auto 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 16px max(20px, env(safe-area-inset-left, 0px)); }
.topbar .logo { padding: 0; }
.topbar .sp { flex: 1; }
.topbar .logo { white-space: nowrap; }

.hero { position: relative; min-height: min(88vh, 860px); display: grid; align-content: end; justify-items: center; padding: 120px 20px 44px; overflow: hidden; isolation: isolate; }
.hero video, .hero .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 11, 8, .55) 0%, rgba(7, 11, 8, .1) 30%, rgba(7, 11, 8, .55) 62%, var(--bg) 100%); }
.hero h1 { font: 600 clamp(30px, 5.6vw, 64px)/1.08 var(--display); letter-spacing: -.02em; text-align: center; max-width: 16ch; text-shadow: 0 2px 30px rgba(0, 0, 0, .5); }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-top: 16px; max-width: 54ch; text-align: center; font-size: clamp(15px, 1.6vw, 18px); color: #e3e6ee; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.promptbar { margin-top: 30px; width: min(820px, 100%); background: rgba(16, 24, 17, .82); backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.promptbar textarea { overflow: hidden; width: 100%; min-height: 58px; border: 0; background: transparent; resize: none; outline: none; font-size: 15px; line-height: 1.5; padding: 4px; }
.promptbar textarea::placeholder { color: #a5acbc; }
.promptbar .row { justify-content: space-between; }
.promptbar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.promptbar .pill { background: rgba(255, 255, 255, .08); color: #dfe3ec; height: 28px; padding: 0 10px; }

.band { max-width: 1120px; margin: 0 auto; padding: 56px 20px; display: grid; gap: 26px; }
.band > h2 { font: 600 clamp(22px, 3vw, 30px)/1.2 var(--display); letter-spacing: -.01em; }
.band > p.sub { color: var(--fg-2); max-width: 62ch; margin-top: -14px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mcard { padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.mcard .n { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.mcard p { color: var(--muted); font-size: 13px; }
.mcard .caps { display: flex; gap: 5px; flex-wrap: wrap; }
.mcard .from { margin-top: 4px; font-size: 13px; color: var(--fg-2); }
.mcard .from b { color: var(--accent); font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; counter-reset: s; }
.step { padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); display: grid; gap: 6px; }
.step::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); font-weight: 700; }
.step b { font-size: 15px; }
.step p { color: var(--muted); font-size: 13.5px; }
.anchor { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 24px; border-radius: var(--r-l); background: linear-gradient(120deg, rgba(181, 239, 106, .12), rgba(99, 207, 69, .06)); border: 1px solid rgba(143, 220, 78, .28); }
.anchor .big { font: 600 clamp(30px, 5vw, 46px)/1 var(--display); letter-spacing: -.02em; }
.anchor small { color: var(--fg-2); font-size: 14px; }
.foot { border-top: 1px solid var(--line); padding: 26px 20px 40px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* đăng nhập / đăng ký */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.auth .art { position: relative; overflow: hidden; }
.auth .art video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, var(--bg) 100%), linear-gradient(0deg, rgba(7, 11, 8, .7), transparent 45%); }
.auth .art blockquote { position: absolute; left: 36px; bottom: 34px; right: 36px; z-index: 1; margin: 0; font: 500 clamp(18px, 2.2vw, 26px)/1.3 var(--display); max-width: 20ch; }
.auth .form { display: grid; align-content: center; justify-items: center; padding: 32px 24px; }
.auth form { width: min(380px, 100%); display: grid; gap: 14px; }
.auth h1 { font-size: 24px; font-weight: 600; }
.auth .switchline { color: var(--muted); font-size: 13.5px; }
.auth .orline { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.auth .orline::before, .auth .orline::after { content: ''; flex: 1; height: 1px; background: var(--line, rgba(255, 255, 255, .12)); }
.auth .gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; text-decoration: none; }
.auth .gbtn:hover { background: #f3f4f6; color: #1f1f1f; }
.auth .gbtn[hidden], .auth .orline[hidden] { display: none; }
.doc { max-width: 760px; margin: 0 auto; padding: 96px 20px 60px; display: grid; gap: 16px; }
.doc h1 { font: 600 28px/1.2 var(--display); }
.doc h2 { font-size: 17px; font-weight: 600; margin-top: 12px; }
.doc p, .doc li { color: var(--fg-2); line-height: 1.7; }
.doc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .hero { min-height: 78vh; padding-top: 96px; }
  .topbar { gap: 6px; padding-inline: 14px; }
  .topbar .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .topbar .btn.ghost[href^="#"] { display: none; }
}

.mcard .from { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mcard .from small { color: var(--muted); font-size: 12px; margin-left: auto; }

/* danh sách model gọn: mỗi model một dòng */
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); column-gap: 28px; border-top: 1px solid var(--line); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.mrow .l { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.mrow .l b { font-size: 15px; font-weight: 600; }
.mrow .l small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.mrow .r { text-align: right; }
.mrow .r b { display: block; font-size: 16px; font-weight: 600; color: var(--accent); }
.mrow .r small { color: var(--muted); font-size: 12px; white-space: nowrap; }

@media (max-width: 480px) { .topbar .logo [data-site-name] { display: none; } }

/* ---- Prism Forge: trang chủ, đăng nhập (kính mờ + hiệu ứng) */
.topbar { background: linear-gradient(180deg, rgba(7, 11, 8, .6), transparent); padding-block: 14px 26px; }
.hero h1 { animation: pf-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero .lede { animation: pf-rise .8s .12s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 em { background: var(--prism); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: pf-hue 8s ease-in-out infinite alternate; }
.promptbar {
  border: 1px solid transparent; animation: pf-rise .8s .22s cubic-bezier(.2, .7, .2, 1) both;
  background: linear-gradient(rgba(12, 19, 13, .5), rgba(12, 19, 13, .5)) padding-box, linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .18)) border-box;
  -webkit-backdrop-filter: blur(26px) saturate(175%); backdrop-filter: blur(26px) saturate(175%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background .25s, box-shadow .25s;
}
.promptbar:focus-within { background: linear-gradient(rgba(12, 19, 13, .68), rgba(12, 19, 13, .68)) padding-box, var(--prism) border-box; box-shadow: 0 28px 90px rgba(0, 0, 0, .6), 0 0 50px rgba(120, 210, 90, .18); }
.promptbar .pill { background: rgba(255, 255, 255, .12); }
.step { background: rgba(16, 24, 17, .5); border-color: rgba(255, 255, 255, .09); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); transition: transform .2s, border-color .2s; }
.step:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .22); }
.step::before { background: var(--prism); }
.anchor { background: linear-gradient(rgba(13, 20, 14, .55), rgba(13, 20, 14, .55)) padding-box, var(--prism) border-box; border: 1px solid transparent; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.anchor .big { background: var(--prism); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: pf-hue 9s ease-in-out infinite alternate; }
.mlist { border-top-color: rgba(255, 255, 255, .1); }
.mrow { border-bottom-color: rgba(255, 255, 255, .08); border-radius: 10px; padding-inline: 12px; transition: background .15s, transform .15s; }
.mrow:hover { background: rgba(255, 255, 255, .05); transform: translateX(3px); }
.band > h2 { animation: pf-rise .6s ease-out both; }
.foot { border-top-color: rgba(255, 255, 255, .08); }
.auth .form form { padding: 26px; border-radius: 20px; background: rgba(14, 22, 15, .5); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08); animation: pf-rise .5s ease-out both; }
.auth .art blockquote { text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }

/* ---- tông "đồng cỏ" + chữ Inter cho trang chủ, đăng nhập, điều khoản */
.hero::after { background: linear-gradient(180deg, rgba(7, 11, 8, .5) 0%, rgba(7, 11, 8, .04) 26%, rgba(7, 11, 8, .34) 60%, var(--bg) 100%); }
.hero h1 { font: 800 clamp(34px, 5.6vw, 72px)/1.02 var(--display); letter-spacing: -.045em; max-width: 15ch; text-shadow: 0 2px 34px rgba(0, 0, 0, .45); }
.hero h1 em { background: var(--prism); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: clamp(15px, 1.5vw, 18px); letter-spacing: -.01em; color: #f1f5ee; }
.band > h2 { font: 750 clamp(23px, 3vw, 32px)/1.15 var(--display); letter-spacing: -.035em; }
.anchor .big { font: 800 clamp(32px, 5vw, 50px)/1 var(--display); letter-spacing: -.045em; }
.step b { font-weight: 650; letter-spacing: -.015em; }
.mrow .l b { font-weight: 650; letter-spacing: -.015em; }
.mrow .r b { font-weight: 700; letter-spacing: -.02em; }
.auth h1 { font-weight: 750; letter-spacing: -.035em; font-size: 26px; }
.auth .art blockquote { font: 750 clamp(20px, 2.3vw, 30px)/1.15 var(--display); letter-spacing: -.035em; max-width: 16ch; }
.doc h1 { font: 800 30px/1.15 var(--display); letter-spacing: -.04em; }
.doc h2 { font-weight: 650; letter-spacing: -.015em; }
.promptbar:focus-within { box-shadow: 0 28px 90px rgba(0, 0, 0, .6), 0 0 50px rgba(126, 217, 87, .16); }
.topbar { background: linear-gradient(180deg, rgba(7, 11, 8, .55), transparent); }
/* chữ nhấn ở tiêu đề: trắng ngả xanh non để đọc rõ trên nền cỏ; khung giá chỉ sáng viền */
.hero h1 em { background: linear-gradient(110deg, #ffffff 0%, #e2f9bd 45%, #a9ec66 100%); -webkit-background-clip: text; background-clip: text; color: transparent; animation: none; filter: drop-shadow(0 2px 16px rgba(0, 0, 0, .5)); }
.hero h1 { text-shadow: 0 2px 30px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .35); }
.anchor { background: linear-gradient(rgba(11, 18, 12, .9), rgba(11, 18, 12, .9)) padding-box, var(--prism) border-box; }
.auth .art::after { inset: 0 -2px 0 0; }
/* bóng chữ của tiêu đề phủ lên phần chữ tô dải màu làm nó xám đi: tắt bóng chữ ở đó, giữ bóng đổ bằng filter */
.hero h1 em { text-shadow: none; }
/* Bố cục trang chủ: tiêu đề + ô nhập nằm ở phần dưới khung hình như ban đầu, nhích lên một chút. */
.hero { padding-bottom: clamp(64px, 11vh, 108px); }
/* Ba mẫu vị trí để chọn, xem bằng /?mau=1, /?mau=2, /?mau=3 (mẫu mặc định là mẫu 2). */
.hero[data-layout="1"] { align-content: end; padding-bottom: 44px; }
.hero[data-layout="2"] { align-content: end; padding-bottom: clamp(64px, 11vh, 108px); }
.hero[data-layout="3"] { align-content: center; padding-top: 110px; padding-bottom: 70px; }

/* Trang /api-docs */
.apidoc { max-width: 880px; }
.apidoc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--fg); overflow-wrap: anywhere; }
.apidoc pre { position: relative; margin: 0; padding: 14px 16px; padding-right: 84px; border-radius: 12px; background: #0a100b; border: 1px solid rgba(255, 255, 255, .09); font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #dfe9d9; white-space: pre-wrap; overflow-wrap: anywhere; }
.apidoc pre .cp { position: absolute; top: 9px; right: 9px; }
.apidoc pre .cp svg { width: 14px; height: 14px; }
.apidoc b { color: var(--fg); font-weight: 600; }
.api-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.api-facts > div { display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: 12px; background: rgba(143, 220, 78, .06); border: 1px solid rgba(143, 220, 78, .2); }
.api-facts small { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.api-facts span { color: var(--fg); font-weight: 550; }
.api-facts code { justify-self: start; }
.apidoc .qsteps { margin: 0; padding-left: 22px; display: grid; gap: 16px; }
.apidoc .qsteps li { color: var(--fg-2); line-height: 1.7; }
.apidoc .qsteps li::marker { color: var(--accent); font-weight: 700; }
.apidoc .qsteps pre { margin-top: 8px; }
.apidoc .tbl { overflow-x: auto; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .09); }
.apidoc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.apidoc th, .apidoc td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(255, 255, 255, .07); color: var(--fg-2); line-height: 1.55; }
.apidoc th { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, .03); }
.apidoc tr:last-child td { border-bottom: 0; }
.apidoc td:first-child { white-space: nowrap; }
.apidoc td em { font-style: normal; font-size: 12px; color: var(--accent); margin-left: 4px; }
.apidoc .m { display: inline-block; min-width: 46px; margin-right: 8px; padding: 2px 6px; border-radius: 6px; font: 700 11.5px/1.5 ui-monospace, Menlo, Consolas, monospace; text-align: center; }
.apidoc .m.get { background: rgba(124, 192, 245, .14); color: #9fd2fb; }
.apidoc .m.post { background: rgba(242, 193, 78, .14); color: #f6d27e; }
.apidoc .st-row { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; color: var(--fg-2); }
.apidoc .st { justify-self: start; padding: 2px 10px; border-radius: 999px; font: 600 13px/1.6 ui-monospace, Menlo, Consolas, monospace; }
.apidoc .st.q { background: rgba(255, 255, 255, .08); color: var(--fg); }
.apidoc .st.r { background: rgba(124, 192, 245, .14); color: #9fd2fb; }
.apidoc .st.d { background: rgba(126, 217, 87, .15); color: #a9ec66; }
.apidoc .st.f { background: rgba(255, 107, 107, .14); color: #ff9a9a; }
.apidoc .st.c { background: rgba(255, 255, 255, .06); color: var(--muted); }
@media (max-width: 720px) {
  .api-facts { grid-template-columns: minmax(0, 1fr); }
  .apidoc td:first-child { white-space: normal; }
}
