/* Trang chủ + đăng nhập — nhận diện SaLy Build, chất "AI automation" trên nền SÁNG: hero kem/trắng có quầng xanh/cam trôi chậm,
   lưới mảnh, tia quét, mạch điện có chấm sáng chạy; bảng "AI đang dựng app" kính trắng chạy vòng lặp; số liệu, ý tưởng, quy trình,
   khối kết xanh đậm. Đăng nhập: thẻ trắng (logo gốc) + panel xanh đậm có sơ đồ trung tâm ∞. Nạp sau platform.css, dùng token của nó.
   Chuyển động chỉ dùng transform/opacity/stroke-dashoffset; mọi vòng lặp tắt khi prefers-reduced-motion. Hiện dần khi cuộn bằng
   CSS scroll-driven trong @supports: trình duyệt không hỗ trợ vẫn thấy nội dung. */

:root {
  --glass: rgb(255 255 255 / 78%);
  --on-dark: #fff;
  --on-dark-2: rgb(255 255 255 / 84%);                          /* ~9.5:1 trên xanh đậm */
  --hairline-dark: rgb(255 255 255 / 16%);
}

/* ---------- Hero sáng ---------- */
.ai-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-bottom: var(--space-5);
  border-radius: var(--radius-xl); border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(227 244 234 / 90%) 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgb(255 235 214 / 95%) 0%, transparent 60%),
    linear-gradient(160deg, #fff 0%, var(--sb-cream) 100%);
  box-shadow: 0 30px 60px -36px rgb(11 93 59 / 35%);
}
.ai-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ai-orb { position: absolute; border-radius: 50%; will-change: transform; }
.ai-orb--1 { width: 30rem; height: 30rem; top: -12rem; left: -9rem; background: radial-gradient(circle, rgb(34 160 107 / 22%), transparent 62%); animation: ai-drift-1 18s ease-in-out infinite alternate; }
.ai-orb--2 { width: 30rem; height: 30rem; right: -9rem; bottom: -14rem; background: radial-gradient(circle, rgb(255 138 0 / 24%), transparent 64%); animation: ai-drift-2 22s ease-in-out infinite alternate; }
.ai-orb--3 { width: 14rem; height: 14rem; right: 32%; top: 14%; background: radial-gradient(circle, rgb(255 170 0 / 16%), transparent 65%); animation: ai-drift-3 16s ease-in-out infinite alternate; }
.ai-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgb(11 93 59 / 6%) 1px, transparent 1px), linear-gradient(90deg, rgb(11 93 59 / 6%) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 25%, transparent 78%);
}
.ai-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgb(34 160 107 / 5%) 85%, rgb(34 160 107 / 14%) 100%);
  transform: translateY(-100%); animation: ai-scan 7s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes ai-drift-1 { to { transform: translate3d(7rem, 4rem, 0) scale(1.15); } }
@keyframes ai-drift-2 { to { transform: translate3d(-6rem, -5rem, 0) scale(1.2); } }
@keyframes ai-drift-3 { to { transform: translate3d(-4rem, 3rem, 0) scale(.85); } }
@keyframes ai-scan { 0% { transform: translateY(-100%); } 70%, 100% { transform: translateY(260%); } }

/* Mạch điện + chấm sáng chạy (circuit-lines.eta) */
.circuit { position: absolute; inset: 0; width: 100%; height: 100%; }
.circuit__trace { fill: none; stroke: rgb(11 93 59 / 11%); stroke-width: 1.5; }
.circuit__pulse { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 100; stroke-dashoffset: 107; opacity: 0; }
.circuit__pulse--green { stroke: var(--sb-green-500); filter: drop-shadow(0 0 4px rgb(34 160 107 / 80%)); }
.circuit__pulse--orange { stroke: var(--sb-orange-500); filter: drop-shadow(0 0 4px rgb(255 138 0 / 80%)); }
@media (prefers-reduced-motion: no-preference) {
  .circuit__pulse { animation: wire-run 5.5s linear infinite; }
  .circuit__pulse--2 { animation-delay: 1.4s; } .circuit__pulse--3 { animation-delay: 2.8s; } .circuit__pulse--4 { animation-delay: 4.1s; }
}
@keyframes wire-run { 0% { stroke-dashoffset: 107; opacity: 0; } 8% { opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 62%, 100% { stroke-dashoffset: 0; opacity: 0; } }

.ai-hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding: var(--space-6) var(--space-5); }
.ai-hero__copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); justify-items: start; align-content: center; min-width: 0; }
.ai-hero__copy > * { margin: 0; }
@media (min-width: 768px) { .ai-hero__inner { padding: var(--space-7) var(--space-6); } }
@media (min-width: 1100px) {
  .ai-hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: var(--space-6); padding: 3.5rem 3rem; }
}

.ai-pill {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: .35rem .85rem .35rem .65rem;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #fff); border-radius: var(--radius-pill); background: var(--glass);
  color: var(--primary); font: 600 .75rem/1.4 var(--font-heading); letter-spacing: .14em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ai-pill__dot { position: relative; width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--sb-green-500); }
.ai-pill__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--sb-green-500); animation: ai-ping 2s var(--ease-out) infinite; }
@keyframes ai-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3); opacity: 0; } }
.ai-hello { font-size: 1.0625rem; font-weight: 600; color: var(--muted); }
.ai-title { font-size: clamp(2.125rem, 1.4rem + 3vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: var(--heading); }
/* "công cụ thật": chữ cam cỡ hiển thị — dải cam-600 → cam-700 (≥ 3.3:1 trên kem); trình duyệt không cắt nền theo chữ: màu cam-600 */
.ai-title__accent {
  color: var(--sb-orange-600);
  background: linear-gradient(100deg, var(--sb-orange-600) 0%, #c45f00 50%, var(--sb-orange-600) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: ai-sheen 8s ease-in-out infinite alternate;
}
@keyframes ai-sheen { to { background-position: 100% 0; } }
.ai-hero .brand-rule { width: 5rem; }
.ai-lead { max-width: 36rem; color: var(--text-2); font-size: 1.0625rem; line-height: 1.65; }

/* Ô "yêu cầu" có chữ gõ tự động */
.ai-prompt {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; max-width: 34rem; min-height: 58px; padding: .45rem .5rem .45rem .9rem;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #fff); border-radius: 18px; background: #fff;
  color: var(--text); text-decoration: none; font-size: 1rem;
  box-shadow: 0 14px 30px -18px rgb(11 93 59 / 45%);
  transition: border-color var(--dur) var(--ease), box-shadow 300ms var(--ease);
}
a.ai-prompt:hover { border-color: var(--sb-green-500); box-shadow: 0 0 0 4px rgb(34 160 107 / 16%), 0 14px 30px -18px rgb(11 93 59 / 45%); }
.ai-prompt__icon { display: inline-grid; place-items: center; color: var(--sb-orange-600); }
.ai-prompt__icon svg { width: 1.25rem; height: 1.25rem; }
.ai-prompt__text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 2px; vertical-align: -.2em; background: var(--sb-green-500); animation: ai-blink 1s steps(1) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }
.ai-prompt__go {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 12px;
  background: var(--primary); color: #fff; transition: transform var(--dur) var(--ease);
}
.ai-prompt__go svg { width: 1.125rem; height: 1.125rem; }
a.ai-prompt:hover .ai-prompt__go { transform: translateX(3px); }

.ai-hero__actions { gap: var(--space-3); }
.btn-glow { position: relative; overflow: hidden; isolation: isolate; }
.btn-glow::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 28%) 50%, transparent 70%);
  transform: translateX(-120%); animation: ai-shine 4.5s var(--ease) infinite 1.5s;
}
@keyframes ai-shine { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
.idea-card:active, .recent-card:active { transform: scale(.98); }

/* Cột phải: bảng AI + câu viết tay */
.ai-hero__visual { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--space-2); min-width: 0; }
.ai-handwrite {
  margin: 0; justify-self: end; transform: rotate(-4deg); font-family: var(--font-accent); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700;
  line-height: 1.2; color: var(--primary);
}

/* Vào trang: các dòng của hero hiện lần lượt; câu viết tay hiện nét từ trái sang */
@media (prefers-reduced-motion: no-preference) {
  .ai-hero__copy > * { animation: ai-rise 700ms var(--ease-out) both; }
  .ai-hero__copy > :nth-child(2) { animation-delay: 70ms; }
  .ai-hero__copy > :nth-child(3) { animation-delay: 140ms; }
  .ai-hero__copy > :nth-child(4) { animation-delay: 210ms; }
  .ai-hero__copy > :nth-child(5) { animation-delay: 280ms; }
  .ai-hero__copy > :nth-child(6) { animation-delay: 350ms; }
  .ai-hero__copy > :nth-child(7) { animation-delay: 420ms; }
  .ai-console { animation: ai-float-in 900ms var(--ease-out) 250ms both; }
  .ai-handwrite { animation: ai-write 900ms var(--ease-out) 1100ms both; }
}
@keyframes ai-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes ai-float-in { from { opacity: 0; transform: translateY(28px) scale(.97); } }
@keyframes ai-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Bảng "AI đang dựng app" (kính trắng) ---------- */
.ai-console {
  --progress: 1;
  position: relative; width: 100%; max-width: 30rem; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, #fff); border-radius: 22px; background: rgb(255 255 255 / 86%);
  box-shadow: 0 40px 70px -36px rgb(11 93 59 / 45%), 0 2px 6px rgb(46 46 46 / 5%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.ai-console::before { /* viền sáng xanh → cam quanh khung */
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(140deg, var(--sb-green-500), transparent 35%, transparent 65%, var(--sb-orange-500));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.ai-console__bar { display: flex; align-items: center; gap: var(--space-3); padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .8125rem; color: var(--text-2); }
.ai-console__dots { display: inline-flex; gap: 6px; }
.ai-console__dots i { width: 10px; height: 10px; border-radius: 50%; background: #e4ddd0; }
.ai-console__dots i:first-child { background: var(--sb-orange-500); }
.ai-console__dots i:nth-child(2) { background: var(--sb-green-500); }
.ai-console__title { display: inline-flex; align-items: center; gap: .45rem; flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-console__mark { width: 1.75rem; flex: none; }
.ai-live { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary); font-size: .6875rem; font-weight: 700; letter-spacing: .08em; }
.ai-live::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--sb-green-500); animation: ai-blink 1.4s steps(1) infinite; }
.ai-console__body { display: grid; gap: var(--space-3); padding: 1rem; }
.ai-msg {
  justify-self: end; max-width: 85%; margin: 0; padding: .55rem .85rem; border-radius: 14px 14px 4px 14px;
  background: var(--accent-soft); color: var(--text); font-size: .875rem; font-weight: 600; line-height: 1.4;
}
.ai-steps { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; }
.ai-step { display: flex; align-items: center; gap: .6rem; color: #767676; transition: color 300ms var(--ease); }
.ai-step__icon { position: relative; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; flex: none; border-radius: 50%; border: 1.5px solid #d6d0c4; transition: background-color 300ms var(--ease), border-color 300ms var(--ease); }
.ai-step__icon svg { width: .8rem; height: .8rem; stroke-width: 3; color: #fff; opacity: 0; transform: scale(.4); transition: opacity 250ms var(--ease-out), transform 350ms var(--ease-out); }
.ai-spinner { position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--sb-orange-500); opacity: 0; }
.ai-step.is-active { color: var(--heading); font-weight: 600; }
.ai-step.is-active .ai-spinner { opacity: 1; animation: ai-spin .8s linear infinite; }
.ai-step.is-done { color: var(--text-2); }
.ai-step.is-done .ai-step__icon { background: var(--sb-green-500); border-color: var(--sb-green-500); }
.ai-step.is-done .ai-step__icon svg { opacity: 1; transform: scale(1); }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-progress { height: 5px; border-radius: var(--radius-pill); background: var(--primary-soft); overflow: hidden; }
.ai-progress span { display: block; height: 100%; border-radius: inherit; background: var(--sb-gradient); transform-origin: left; transform: scaleX(var(--progress)); transition: transform 900ms var(--ease-out); }
/* Chỗ của app kết quả: trước khi xuất bản hiện khung xương nhấp nháy (giữ chỗ, không nhảy bố cục) */
.ai-result-slot { position: relative; display: grid; }
.ai-result-slot > * { grid-area: 1 / 1; }
.ai-skeleton { display: grid; align-content: space-evenly; gap: .55rem; padding: .85rem; border: 1px dashed #d6d0c4; border-radius: 14px; opacity: 1; transition: opacity 300ms var(--ease); }
.ai-skeleton i { display: block; height: .7rem; border-radius: var(--radius-pill); background: linear-gradient(90deg, #f1ebe0 0%, #fbf6ee 50%, #f1ebe0 100%); background-size: 200% 100%; animation: ai-shimmer 1.4s linear infinite; }
.ai-skeleton i:nth-child(1) { width: 55%; } .ai-skeleton i:nth-child(2) { width: 85%; } .ai-skeleton i:nth-child(3) { width: 70%; } .ai-skeleton i:nth-child(4) { width: 40%; height: 1.4rem; }
.ai-console.is-published .ai-skeleton { opacity: 0; }
@keyframes ai-shimmer { to { background-position: -200% 0; } }
.ai-result {
  display: grid; gap: .45rem; padding: .85rem; border-radius: 14px; background: #fff; color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px rgb(11 93 59 / 50%);
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity 450ms var(--ease-out), transform 600ms var(--ease-out);
}
.ai-console.is-published .ai-result { opacity: 1; transform: none; }
.ai-result__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-size: .75rem; }
.ai-result__url { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-result__url svg { width: .9rem; height: .9rem; color: var(--sb-green-500); }
.ai-badge { flex: none; padding: .1rem .5rem; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.ai-result__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); font-size: .8125rem; color: var(--text-2); }
.ai-result__row strong { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.ai-result__row--accent strong { color: var(--sb-orange-700); }
.ai-result__meter { height: 6px; border-radius: var(--radius-pill); background: var(--accent-soft); overflow: hidden; }
.ai-result__meter span { display: block; width: 59%; height: 100%; border-radius: inherit; background: var(--sb-gradient); transform-origin: left; transform: scaleX(1); transition: transform 900ms var(--ease-out) 200ms; }
.ai-console:not(.is-published) .ai-result__meter span { transform: scaleX(0); }
@media (max-width: 479px) {
  .ai-hero__actions > .btn { flex: 1 1 100%; }
  .ai-console__body { padding: .85rem; }
  .ai-hero__inner { padding: var(--space-5) var(--space-4) var(--space-6); }
  .ai-prompt { font-size: .9375rem; }
  .ai-handwrite { justify-self: center; }
  .ai-pill { letter-spacing: .08em; }
}

/* ---------- Dải số liệu (nổi chồng lên đáy hero) ---------- */
.stat-band {
  position: relative; z-index: 1; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: -3.25rem var(--space-3) var(--space-6);
}
.ai-hero:has(+ .stat-band) { padding-bottom: 2.5rem; }
@media (min-width: 900px) { .stat-band { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-inline: var(--space-6); gap: var(--space-4); } }
.stat-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon value" "label label"; align-items: center; gap: .4rem .75rem;
  padding: var(--space-4); background: rgb(255 255 255 / 94%); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px -26px rgb(11 93 59 / 45%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.stat-tile__icon { grid-area: icon; width: 2.5rem; height: 2.5rem; }
.stat-tile__icon svg { width: 1.25rem; height: 1.25rem; }
.stat-tile__value { grid-area: value; font-family: var(--font-heading); font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem); font-weight: 800; line-height: 1; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat-tile__label { grid-area: label; font-size: .8125rem; font-weight: 600; color: var(--muted); line-height: 1.35; }
@media (prefers-reduced-motion: no-preference) {
  .stat-tile { animation: ai-rise 700ms var(--ease-out) both; }
  .stat-tile:nth-child(1) { animation-delay: 350ms; } .stat-tile:nth-child(2) { animation-delay: 420ms; }
  .stat-tile:nth-child(3) { animation-delay: 490ms; } .stat-tile:nth-child(4) { animation-delay: 560ms; }
}

/* ---------- Các khối bên dưới ---------- */
.home-section { margin-top: var(--space-7); scroll-margin-top: calc(var(--header-h) + 1rem); }
.home-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-4); }
.home-section__head h2 { margin: 0; font-size: clamp(1.375rem, 1.15rem + .8vw, 1.75rem); }
.home-section__note { margin: 0; max-width: 26rem; color: var(--muted); font-size: .9375rem; }
.link-more { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-weight: 600; text-decoration: none; }
.link-more svg { width: 1rem; height: 1rem; transition: transform var(--dur) var(--ease); }
.link-more:hover svg { transform: translateX(3px); }

/* Ánh sáng theo con trỏ trên thẻ (home-landing.js đặt --mx/--my) */
.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgb(34 160 107 / 12%), transparent 65%);
  transition: opacity 300ms var(--ease);
}
.glow-card:hover::before { opacity: 1; }

/* App gần đây */
.recent-grid, .idea-grid { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.recent-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.recent-card {
  display: flex; align-items: center; gap: var(--space-3); min-height: 76px; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow-1); transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease), border-color var(--dur) var(--ease);
}
.recent-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--sb-green-500) 40%, #fff); box-shadow: var(--shadow-2); }
.recent-card__avatar {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--sb-green-900), var(--sb-green-500)); color: #fff; font: 800 1.25rem/1 var(--font-heading); text-transform: uppercase;
}
.recent-card__body { display: grid; gap: .2rem; flex: 1; min-width: 0; }
.recent-card__body strong { font-family: var(--font-heading); color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card__meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.recent-card__meta .brand-chip, .recent-card__meta .tag { min-height: 1.375rem; font-size: .75rem; }
.recent-card__body small { color: var(--muted); }
.recent-card__go { color: var(--primary); transition: transform var(--dur) var(--ease); }
.recent-card__go svg { width: 1.125rem; height: 1.125rem; }
.recent-card:hover .recent-card__go { transform: translateX(3px); }

/* Ý tưởng mẫu: ô icon đặc xanh/cam xen kẽ, nút mũi tên tròn (mockup H6) */
.idea-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: var(--space-4); }
.idea-card {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-2); height: 100%; padding: var(--space-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; color: var(--text); text-decoration: none;
  box-shadow: var(--shadow-1); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color var(--dur) var(--ease);
}
.idea-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--sb-green-500) 40%, #fff); box-shadow: 0 24px 40px -26px rgb(11 93 59 / 45%); }
.idea-card__icon { margin-bottom: var(--space-1); transition: transform 400ms var(--ease-out); }
.idea-card:hover .idea-card__icon { transform: rotate(-6deg) scale(1.06); }
.idea-card__title { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 700; line-height: 1.3; color: var(--heading); }
.idea-card__text { color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.idea-card__cta { display: inline-flex; align-items: center; justify-content: space-between; gap: .35rem; margin-top: var(--space-2); color: var(--primary); font-weight: 600; font-size: .9375rem; }
.idea-card__go { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.idea-card__go svg { width: 1rem; height: 1rem; }
.idea-card:hover .idea-card__go { transform: translateX(3px); background: var(--primary); color: #fff; }

/* Quy trình 4 bước: nút đổi màu xanh → cam theo bước; đoạn nối có "gói dữ liệu" chạy qua lần lượt */
.flow { display: grid; gap: var(--space-5); margin: 0; padding: var(--space-5) var(--space-4); list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-1); }
.flow__step { --i: 0; --node: var(--sb-green-900); position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: var(--space-4); align-items: start; }
.flow__step:nth-child(2) { --i: 1; --node: var(--sb-green-500); }
.flow__step:nth-child(3) { --i: 2; --node: var(--sb-orange-300); }
.flow__step:nth-child(4) { --i: 3; --node: var(--sb-orange-500); }
.flow__step:not(:last-child)::before, .flow__step:not(:last-child)::after {
  content: ""; position: absolute; left: 27px; top: 64px; bottom: calc(8px - var(--space-5)); width: 2px; border-radius: 2px;
}
.flow__step:not(:last-child)::before { background: linear-gradient(180deg, var(--node), color-mix(in srgb, var(--node) 30%, #fff)); opacity: .5; }
.flow__step:not(:last-child)::after { background: linear-gradient(180deg, transparent, var(--sb-orange-500), transparent) no-repeat; background-size: 100% 60%; background-position: 0 -200%; }
.flow__step h3 { grid-column: 2; margin: .35rem 0 .2rem; }
.flow__step p { grid-column: 2; margin: 0; color: var(--muted); font-size: .9375rem; }
.flow__node {
  position: relative; z-index: 1; grid-row: span 2; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: var(--node); color: #fff; box-shadow: 0 10px 24px -12px rgb(11 93 59 / 55%);
}
.flow__step:nth-child(3) .flow__node, .flow__step:nth-child(4) .flow__node { color: var(--sb-ink); }
.flow__node svg { width: 1.5rem; height: 1.5rem; }
.flow__num {
  position: absolute; right: -6px; top: -6px; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%;
  background: var(--surface); color: var(--heading); font: 700 .75rem/1 var(--font-heading); box-shadow: 0 0 0 2px var(--node);
}
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--space-6) var(--space-5); text-align: center; }
  .flow__step { grid-template-columns: 1fr; justify-items: center; }
  .flow__step:not(:last-child)::before, .flow__step:not(:last-child)::after { left: calc(50% + 36px); top: 27px; bottom: auto; width: calc(100% + var(--space-5) - 72px); height: 2px; }
  .flow__step:not(:last-child)::before { background: linear-gradient(90deg, var(--node), color-mix(in srgb, var(--node) 30%, #fff)); }
  .flow__step:not(:last-child)::after { background: linear-gradient(90deg, transparent, var(--sb-orange-500), transparent) no-repeat; background-size: 60% 100%; background-position: -200% 0; }
  .flow__step h3, .flow__step p { grid-column: 1; }
  .flow__step h3 { margin-top: var(--space-4); }
  .flow__node { grid-row: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .flow__step::after { animation: ai-packet-y 3.2s var(--ease) infinite; animation-delay: calc(var(--i) * .8s + .4s); }
  .flow__node { animation: ai-node 3.2s var(--ease) infinite; animation-delay: calc(var(--i) * .8s); }
  @media (min-width: 900px) { .flow__step::after { animation-name: ai-packet-x; } }
}
@keyframes ai-packet-y { 0% { background-position: 0 -200%; } 25%, 100% { background-position: 0 300%; } }
@keyframes ai-packet-x { 0% { background-position: -200% 0; } 25%, 100% { background-position: 300% 0; } }
@keyframes ai-node { 0%, 18%, 100% { transform: none; } 8% { transform: translateY(-3px) scale(1.06); } }

/* Lối tắt quản trị trên trang chủ */
.home-section .shortcut { border-radius: var(--radius); }

/* ---------- Khối kết xanh đậm: sóng xanh/cam ở mép trên (motif bộ ứng dụng nhận diện) ---------- */
.closing-band {
  position: relative; margin-top: var(--space-7); overflow: hidden; border-radius: var(--radius-xl); color: var(--on-dark);
  background: radial-gradient(80% 120% at 100% 100%, rgb(34 160 107 / 45%), transparent 60%), linear-gradient(160deg, var(--sb-green-900), var(--sb-green-950));
}
.closing-band__wave { display: block; width: 100%; height: 28px; }
.closing-band__wave .wave-cut { fill: var(--surface-page); }
.closing-band__wave .wave-line { fill: none; stroke: var(--sb-orange-500); stroke-width: 3; }
.closing-band__inner { display: grid; gap: var(--space-5); align-items: center; justify-items: start; padding: var(--space-5) var(--space-5) var(--space-6); }
@media (min-width: 900px) { .closing-band__inner { grid-template-columns: auto 1fr auto; padding: var(--space-5) var(--space-6) var(--space-6); } }
.closing-band__mark { display: inline-grid; place-items: center; width: 5rem; height: 5rem; border-radius: 22px; background: #fff; box-shadow: 0 12px 28px -12px rgb(0 0 0 / 45%); }
.closing-band__mark .brand-logo { width: 3.75rem; }
.closing-band__values { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0 0 var(--space-2); padding: 0; list-style: none; font: 600 1rem/1.4 var(--font-heading); }
.closing-band__values li { display: inline-flex; align-items: center; gap: .45rem; }
.closing-band__values svg { width: 1.125rem; height: 1.125rem; color: var(--sb-on-dark-accent); stroke-width: 3; }
.closing-band__hand { margin: 0; font-family: var(--font-accent); font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); font-weight: 700; line-height: 1.2; color: var(--sb-on-dark-accent); }
.closing-band :focus-visible { outline-color: var(--sb-on-dark-accent); }

/* Hiện dần khi cuộn tới (chỉ trình duyệt có scroll-driven animation; còn lại hiện ngay) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: ai-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}
@keyframes ai-reveal { from { opacity: 0; transform: translateY(32px); } }

/* ---------- Đăng nhập: thẻ trắng (lên trước trên điện thoại) + panel thương hiệu xanh đậm ---------- */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: stretch; }
.auth-split .auth-card {
  position: relative; align-content: center; width: 100%; max-width: 30rem; margin: 0 auto; padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-xl); box-shadow: 0 30px 60px -36px rgb(11 93 59 / 40%);
}
.auth-card h1 { margin: 0; font-size: 1.75rem; }
.auth-panel {
  position: relative; isolation: isolate; overflow: hidden; display: grid; gap: var(--space-4); align-content: center; min-width: 0;
  padding: var(--space-6) var(--space-5); border-radius: var(--radius-xl); color: var(--on-dark);
  background:
    radial-gradient(90% 70% at 100% 0%, rgb(34 160 107 / 40%), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgb(255 138 0 / 18%), transparent 60%),
    linear-gradient(160deg, var(--sb-green-900), var(--sb-green-950));
  box-shadow: 0 30px 60px -30px rgb(6 63 40 / 60%);
}
.auth-panel > * { margin: 0; }
.auth-panel__watermark { position: absolute; z-index: -1; right: -18%; bottom: -14%; width: 75%; opacity: .07; filter: brightness(0) invert(1); pointer-events: none; }
.auth-panel__eyebrow { font: 600 .75rem/1.4 var(--font-heading); letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-2); }
.auth-panel__title { font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.875rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; color: var(--on-dark); }
.auth-panel__title span { color: var(--sb-on-dark-accent); }
.auth-panel__lead { max-width: 34rem; color: var(--on-dark-2); font-size: 1.0625rem; line-height: 1.6; }
.auth-panel__brands { font-size: .875rem; font-weight: 600; color: var(--on-dark-2); }
.auth-panel :focus-visible { outline-color: var(--sb-on-dark-accent); }
.ai-checks { display: grid; gap: .6rem; padding: 0; list-style: none; color: var(--on-dark-2); font-size: .9375rem; }
.ai-checks li { display: flex; align-items: center; gap: .6rem; }
.ai-checks__icon { display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; flex: none; border-radius: 50%; background: rgb(255 181 77 / 20%); color: var(--sb-on-dark-accent); }
.ai-checks__icon svg { width: .8rem; height: .8rem; stroke-width: 3; }

/* Sơ đồ trung tâm ∞ (brand-hub-diagram.eta) */
.hub { position: relative; width: 100%; max-width: 30rem; aspect-ratio: 400 / 260; }
.hub__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hub__wire { fill: none; stroke: rgb(255 255 255 / 22%); stroke-width: 1.5; }
.hub__pulse { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 100; stroke-dashoffset: 110; opacity: 0; }
.hub__pulse--1, .hub__pulse--4 { stroke: #6fe0a8; filter: drop-shadow(0 0 4px rgb(111 224 168 / 90%)); }
.hub__pulse--2, .hub__pulse--3 { stroke: var(--sb-on-dark-accent); filter: drop-shadow(0 0 4px rgb(255 181 77 / 90%)); }
@media (prefers-reduced-motion: no-preference) {
  .hub__pulse { animation: wire-run 4s linear infinite; }
  .hub__pulse--2 { animation-delay: 1s; } .hub__pulse--3 { animation-delay: 2s; } .hub__pulse--4 { animation-delay: 3s; }
  .hub__core { animation: hub-glow 3.6s ease-in-out infinite; }
}
.hub__core {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 24%; background: #fff; box-shadow: 0 0 0 6px rgb(255 255 255 / 10%), 0 18px 40px -12px rgb(0 0 0 / 45%);
}
.hub__core .brand-logo { width: 74%; }
@keyframes hub-glow { 50% { box-shadow: 0 0 0 10px rgb(255 255 255 / 6%), 0 0 36px 4px rgb(111 224 168 / 35%), 0 18px 40px -12px rgb(0 0 0 / 45%); } }
.hub__node {
  position: absolute; display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .6rem; transform: translateY(-50%); white-space: nowrap;
  border: 1px solid var(--hairline-dark); border-radius: 12px; background: rgb(255 255 255 / 10%); color: var(--on-dark);
  font-size: .75rem; font-weight: 600; line-height: 1.25; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hub__node svg { width: 1rem; height: 1rem; color: var(--sb-on-dark-accent); }
.hub__node--tl { left: 0; top: 18.5%; } .hub__node--tr { right: 0; top: 18.5%; }
.hub__node--bl { left: 0; top: 81.5%; } .hub__node--br { right: 0; top: 81.5%; }
@media (max-width: 479px) { .hub { display: none; } }

@media (min-width: 1024px) {
  .auth-split { grid-template-columns: minmax(0, 1.3fr) minmax(22rem, .7fr); min-height: calc(100dvh - 9rem); }
  .auth-split .auth-card { grid-column: 2; grid-row: 1; }
  .auth-panel { grid-column: 1; grid-row: 1; padding: 3.5rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-orb, .ai-scan, .ai-pill__dot::after, .ai-title__accent, .ai-caret, .btn-glow::after, .ai-skeleton i, .ai-live::before { animation: none !important; }
  .ai-scan, .btn-glow::after, .circuit__pulse, .hub__pulse { display: none; }
}
