/*
 * Trang tĩnh fiteath.com (điều khoản, chính sách quyền riêng tư).
 *
 * Màu lấy từ token của app (lib/ui/theme/color/color_light.dart) để trang mở
 * từ app không lạc tông. KHÔNG tải font/script từ bên ngoài: trang chính sách
 * quyền riêng tư mà gửi IP người đọc cho Google Fonts thì tự mâu thuẫn.
 */
:root {
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface2: #eef3ee;
  --ink: #17201b;
  --ink2: #46534b;
  --muted: #6c7972;
  --line: #e2e8e2;
  --primary: #2c8a5b;
  --green-bg: #e6f3ec;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1511;
    --surface: #161e19;
    --surface2: #1c2620;
    --ink: #e8efe9;
    --ink2: #c3cec6;
    --muted: #93a098;
    --line: #26322b;
    --primary: #5cc28e;
    --green-bg: #163324;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1511;
  --surface: #161e19;
  --surface2: #1c2620;
  --ink: #e8efe9;
  --ink2: #c3cec6;
  --muted: #93a098;
  --line: #26322b;
  --primary: #5cc28e;
  --green-bg: #163324;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--primary);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Đầu trang ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
}

.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
}

.lang a,
.lang span {
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}

.lang [aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

/* ── Nội dung ──────────────────────────────────────────────── */
/* `.wrap` đặt padding ngang; chỉ thêm khoảng trên/dưới (đừng dùng shorthand, sẽ đè mất lề 16px). */
main.wrap {
  padding-top: 32px;
  padding-bottom: 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.meta {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

h2 {
  margin: 40px 0 12px;
  font-size: 20px;
  line-height: 1.35;
}

h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin: 4px 0;
}

.summary {
  margin: 0 0 24px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--green-bg);
}

.summary h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.summary ul {
  margin: 0;
}

.toc {
  margin: 0 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc p {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  font-size: 15px;
}

.table-scroll {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--surface2);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.note {
  padding: 12px 16px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}

.contact-line {
  margin: -12px 0 24px;
  font-size: 14px;
  color: var(--ink2);
}

.contact-card {
  margin: 0 0 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-card .contact-email {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.contact-card .meta {
  margin: 8px 0 0;
}

/* ── Trang chủ (landing) ───────────────────────────────────
 * CSP của site là `style-src 'self'` ⇒ KHÔNG dùng thuộc tính style="" hay
 * thẻ <style> trong HTML: mọi thứ phải nằm ở file này.
 */
.wrap-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.lp-hero {
  padding: 40px 0 48px;
  background: linear-gradient(180deg, var(--green-bg) 0%, var(--bg) 100%);
}

.lp-hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.lp-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.lp-hero h1 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lp-lead {
  margin: 0 0 24px;
  color: var(--ink2);
  font-size: 18px;
  line-height: 1.55;
}

.lp-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Nút tải. `.store--soon` = app chưa lên store (không bấm được). Khi app được
 * duyệt: đổi <span class="store store--soon"> thành <a class="store" href=…>
 * (xem ghi chú đầu index.html). */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 168px;
  min-height: 52px;
  padding: 8px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  line-height: 1.2;
}

.store small {
  font-size: 11px;
  opacity: 0.8;
}

.store strong {
  font-size: 17px;
  font-weight: 600;
}

.store--soon {
  background: var(--surface);
  color: var(--ink);
  border: 1px dashed var(--muted);
  cursor: default;
}

.lp-hero-visual {
  display: flex;
  justify-content: center;
}

/* Khung điện thoại bọc ảnh chụp màn hình (ảnh 600px, đã cắt thanh trạng thái). */
.phone {
  width: 260px;
  margin: 0;
  padding: 8px;
  border-radius: 36px;
  background: #101512;
  /* viền mảnh `line` để khung không chìm vào nền ở chế độ tối */
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px rgb(23 32 27 / 18%), 0 4px 12px rgb(23 32 27 / 10%);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
}

.lp-section {
  padding: 56px 0;
}

.lp-section--alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lp-section h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lp-sub {
  margin: 0 0 32px;
  max-width: 640px;
  color: var(--ink2);
}

.features {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lp-section--alt .feature {
  background: var(--bg);
}

.feature h3 {
  margin: 12px 0 6px;
  font-size: 17px;
}

.feature p {
  margin: 0;
  color: var(--ink2);
  font-size: 15px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-bg);
  color: var(--primary);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

/* Dãy ảnh: vuốt ngang trên điện thoại, xếp hàng trên màn rộng. */
.shots {
  display: flex;
  gap: 24px;
  margin: 0 -16px;
  padding: 8px 16px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
}

.shots li {
  flex: none;
  margin: 0;
  scroll-snap-align: center;
}

.shots figure {
  margin: 0;
}

.shots figcaption {
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
}

.shots figcaption span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0;
  padding: 0 0 0 56px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.steps h3 {
  margin: 6px 0 4px;
  font-size: 17px;
}

.steps p {
  margin: 0;
  color: var(--ink2);
}

.checks {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin: 0;
  padding-left: 32px;
}

.checks li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--green-bg);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.checks li::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 6px;
  height: 9px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lp-split {
  display: grid;
  gap: 24px;
}

.lp-panel {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--green-bg);
}

.lp-panel h2 {
  font-size: 22px;
}

.lp-cta {
  text-align: center;
}

.lp-cta .store-row {
  justify-content: center;
  margin: 24px 0 16px;
}

.lp-cta p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--ink2);
}

.site-footer .fine {
  margin: 8px 0 0;
  font-size: 13px;
}

@media (min-width: 600px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }

  .lp-section h2 {
    font-size: 30px;
  }
}

@media (min-width: 880px) {
  .lp-hero {
    padding: 72px 0 80px;
  }

  .lp-hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .lp-hero h1 {
    font-size: 52px;
  }

  .phone {
    width: 300px;
  }

  .features {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .shots {
    justify-content: center;
    margin: 0;
    padding: 8px 0 24px;
    overflow: visible;
  }

  .steps {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .lp-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Hiệu ứng trang chủ ─────────────────────────────────────
 * Hai lớp, cả hai tự tắt khi người xem bật "giảm chuyển động":
 *  1. Mở trang: chữ đầu trang hiện lần lượt, điện thoại phóng vào (CSS thuần).
 *  2. Cuộn: `site.js` gắn `.motion` lên <html> (ngay trong <head>) rồi thêm
 *     `.is-in` cho khối khi cuộn tới, và cập nhật --zoom / --out theo vị trí
 *     cuộn. Không có JS ⇒ không có `.motion` ⇒ mọi thứ hiện bình thường.
 * Danh sách khối ẩn-sẵn dưới đây PHẢI khớp biến REVEAL trong site.js.
 */
@keyframes lp-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes lp-phone-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lp-hero-grid > div:first-child > * {
    animation: lp-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .lp-hero-grid > div:first-child > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .lp-hero-grid > div:first-child > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .lp-hero-grid > div:first-child > :nth-child(4) {
    animation-delay: 0.24s;
  }

  .lp-hero-grid > div:first-child > :nth-child(5) {
    animation-delay: 0.32s;
  }

  .lp-hero .phone {
    animation: lp-phone-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
  }
}

/* Hiện dần khi cuộn tới. */
.motion .lp-section h2,
.motion .lp-sub,
.motion .feature,
.motion .steps li,
.motion .lp-panel,
.motion .lp-cta .store-row,
.motion .lp-cta p {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s);
}

.motion .is-in {
  opacity: 1 !important;
  transform: none !important;
}

/* Lệch nhịp trái → phải cho các ô cùng hàng / các bước. */
.features .feature:nth-child(3n + 2),
.steps li:nth-child(2) {
  --d: 0.1s;
}

.features .feature:nth-child(3n),
.steps li:nth-child(3) {
  --d: 0.2s;
}

.lp-sub,
.lp-cta .store-row {
  --d: 0.08s;
}

.lp-cta p {
  --d: 0.16s;
}

/* Thu phóng theo cuộn (giá trị do site.js tính theo vị trí, không transition). */
.motion .shots figure {
  opacity: calc(0.35 + 0.65 * var(--zoom, 0));
  transform: scale(calc(0.8 + 0.2 * var(--zoom, 0)));
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.motion .lp-hero-visual {
  opacity: calc(1 - 0.75 * var(--out, 0));
  transform: translateY(calc(48px * var(--out, 0))) scale(calc(1 - 0.14 * var(--out, 0)));
  will-change: transform, opacity;
}

/* ── Chân trang ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

@media (min-width: 600px) {
  h1 {
    font-size: 32px;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .site-header,
  .site-footer,
  .lang,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

