/* ===========================================================================
   SitesMap — Landing site styles
   Màu đồng bộ với app SitesMap (lib/core/theme/app_theme.dart):
   seedColor = #0D6E6E (teal đậm), Material 3, hỗ trợ sáng/tối.
   =========================================================================== */

:root {
  /* Bảng màu thương hiệu — bắt nguồn từ seed #0D6E6E */
  --brand:            #0D6E6E;
  --brand-dark:       #0A5757;
  --brand-light:      #15918F;
  --brand-50:         #E6F2F2;
  --on-brand:         #FFFFFF;

  /* Nền & chữ (light) */
  --bg:               #F5F8F8;
  --surface:          #FFFFFF;
  --surface-alt:      #EEF4F4;
  --text:             #14201F;
  --text-muted:       #5A6B6A;
  --border:           #D8E3E2;

  --radius:           16px;
  --radius-sm:        12px;
  --shadow:           0 10px 30px rgba(13, 110, 110, 0.10);
  --shadow-lg:        0 18px 50px rgba(13, 110, 110, 0.18);
  --max-width:        1080px;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

/* Chế độ tối — bám sát ColorScheme.fromSeed(dark) của app */
@media (prefers-color-scheme: dark) {
  :root {
    --brand:        #5FD4D2;
    --brand-dark:   #2BA8A6;
    --brand-light:  #7FE0DE;
    --brand-50:     #15302F;
    --on-brand:     #003736;

    --bg:           #0E1716;
    --surface:      #16211F;
    --surface-alt:  #1D2C2A;
    --text:         #E6F0EF;
    --text-muted:   #9DB2B0;
    --border:       #2A3B39;
    --shadow:       0 10px 30px rgba(0, 0, 0, 0.40);
    --shadow-lg:    0 18px 50px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: var(--on-brand);
  flex: none;
}
.brand .logo svg { width: 20px; height: 20px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--brand);
  background: var(--brand-50);
  text-decoration: none;
}

/* Nút chuyển ngôn ngữ VI / EN */
.lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}
.lang-switch a {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 0;
  letter-spacing: 0.02em;
}
.lang-switch a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.lang-switch a[aria-current="true"] {
  background: var(--brand);
  color: var(--on-brand);
}
.lang-switch a[aria-current="true"]:hover { background: var(--brand-dark); color: var(--on-brand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease,
              border-color .2s ease, opacity .2s ease;
  min-width: 200px;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow-lg); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn .icon { width: 22px; height: 22px; flex: none; }
.btn .btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.btn .btn-text small { font-size: 0.72rem; font-weight: 500; opacity: 0.85; }
.btn .btn-text strong { font-size: 1.02rem; font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    radial-gradient(700px 380px at 0% 110%, color-mix(in srgb, var(--brand-light) 16%, transparent), transparent 55%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 72px 0 80px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--brand), var(--brand-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  max-width: 52ch;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 22px;
}
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}
.download-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Phone mockup */
.hero-art { display: grid; place-items: center; }
.phone {
  width: 260px;
  height: 520px;
  border-radius: 38px;
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
  padding: 12px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: 84px; height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.5);
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 28px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-screen .ps-bar {
  height: 54px;
  background: var(--brand);
  color: var(--on-brand);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  font-weight: 700;
}
.phone-screen .ps-map {
  flex: 1;
  background:
    linear-gradient(0deg, rgba(13,110,110,.06), rgba(13,110,110,.06)),
    repeating-linear-gradient(0deg, var(--surface-alt) 0 38px, var(--surface) 38px 39px),
    repeating-linear-gradient(90deg, var(--surface-alt) 0 38px, var(--surface) 38px 39px);
  position: relative;
}
.phone-screen .pin {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  background: var(--brand);
  transform: rotate(-45deg);
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
}
.phone-screen .pin.p1 { top: 30%;  left: 28%; }
.phone-screen .pin.p2 { top: 52%;  left: 62%; background: var(--brand-light); }
.phone-screen .pin.p3 { top: 70%;  left: 38%; background: var(--brand-dark); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-title {
  text-align: center;
  margin: 0 auto 12px;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: -0.01em;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 44px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.feature-card .fc-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-50);
  color: var(--brand);
  margin-bottom: 16px;
}
.feature-card .fc-icon svg { width: 26px; height: 26px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.96rem; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: var(--on-brand);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { margin: 0 0 10px; font-size: clamp(1.4rem, 3vw, 2rem); }
.cta-band p { margin: 0 0 26px; opacity: 0.92; }
.cta-band .download-row { justify-content: center; }
.cta-band .btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--on-brand);
  border-color: rgba(255,255,255,0.4);
}
.cta-band .btn-secondary:hover { background: rgba(255,255,255,0.2); color: var(--on-brand); }
.cta-band .btn-primary {
  background: var(--on-brand);
  color: var(--brand-dark);
}
.cta-band .btn-primary:hover { background: #eef9f9; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 0 28px;
  margin-top: 24px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.footer-grid .brand { margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-muted); font-size: 0.95rem; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- Legal pages (privacy / terms) ---------- */
.legal-hero {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: var(--on-brand);
  padding: 56px 0;
}
.legal-hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.legal-hero p { margin: 0; opacity: 0.92; }
.legal-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
  margin: -36px auto 64px;
  max-width: 860px;
  position: relative;
}
.legal-body h2 {
  font-size: 1.3rem;
  margin: 34px 0 10px;
  padding-top: 8px;
  scroll-margin-top: 84px;
}
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.legal-body p, .legal-body li { color: var(--text); }
.legal-body ul { padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body .muted { color: var(--text-muted); }
.legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.95rem;
}
.legal-body th, .legal-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-body th { background: var(--brand-50); color: var(--text); }
.callout {
  background: var(--brand-50);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 18px 0;
  color: var(--text);
}
.toc {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 28px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc a { font-size: 0.95rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .download-row { justify-content: center; }
  .features { grid-template-columns: 1fr 1fr; }
  .toc ol { columns: 1; }
}

@media (max-width: 560px) {
  .nav { height: 58px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 9px; font-size: 0.88rem; }
  .features { grid-template-columns: 1fr; }
  .btn { width: 100%; min-width: 0; }
  .download-row { flex-direction: column; }
  .hero-inner { padding: 48px 0 56px; }
  section { padding: 48px 0; }
  .phone { width: 220px; height: 440px; }
  .footer-bottom { flex-direction: column; }
}

/* Người dùng tắt animation */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
