/* ngoctien.ng — design system dùng chung (lấy cảm hứng từ Apple HIG).
   Sáng/tối tự động · chữ hệ thống · kính mờ · phản hồi ngay khi nhấn. */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, rgba(0,113,227,.10), transparent 60%);
  --surface: #ffffff;
  --surface-2: #fafafc;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --line: rgba(0,0,0,.08);
  --line-strong: rgba(0,0,0,.16);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-fg: #ffffff;
  --accent-soft: rgba(0,113,227,.10);
  --ok: #248a3d;
  --err: #d70015;
  --warn-bg: #fff8e6;
  --warn-line: #f0c36d;
  --glass: rgba(251,251,253,.72);
  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --shadow-2: 0 2px 4px rgba(0,0,0,.05), 0 18px 44px rgba(0,0,0,.12);
  --r-s: 10px; --r-m: 14px; --r-l: 22px; --r-xl: 28px;
  --ease: cubic-bezier(.22,1,.36,1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
}
@media all {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --bg-grad: radial-gradient(1200px 600px at 50% -10%, rgba(41,151,255,.16), transparent 60%);
    --surface: #1c1c1e;
    --surface-2: #161618;
    --fg: #f5f5f7;
    --fg-2: #a1a1a6;
    --fg-3: #86868b;
    --line: rgba(255,255,255,.10);
    --line-strong: rgba(255,255,255,.20);
    --accent: #2997ff;
    --accent-hover: #4aa8ff;
    --accent-fg: #ffffff;
    --accent-soft: rgba(41,151,255,.16);
    --ok: #32d74b;
    --err: #ff453a;
    --warn-bg: rgba(255,214,10,.08);
    --warn-line: rgba(255,214,10,.35);
    --glass: rgba(22,22,24,.72);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 2px 4px rgba(0,0,0,.4), 0 18px 44px rgba(0,0,0,.55);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg) var(--bg-grad) no-repeat;
  color: var(--fg);
  font: 17px/1.5 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }

/* Thanh điều hướng kính mờ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line);
}
.nav-in { max-width: 1080px; margin: 0 auto; padding: 0 22px; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav .brand { color: var(--fg); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.nav .brand:hover { text-decoration: none; }
.nav .links { display: flex; gap: 22px; font-size: 14px; }
.nav .links a { color: var(--fg-2); transition: color .2s; }
.nav .links a:hover { color: var(--fg); text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 22px; }

/* Hero */
.hero { text-align: center; padding: clamp(56px, 11vw, 120px) 22px clamp(36px, 6vw, 64px); }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: -.005em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(38px, 8vw, 72px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; }
.hero .lead { margin: 18px auto 0; max-width: 620px; font-size: clamp(18px, 2.4vw, 23px); line-height: 1.38; color: var(--fg-2); letter-spacing: -.016em; }
.grad { background: linear-gradient(120deg, #0071e3, #7d4cf0 55%, #e8478b); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .grad { background-image: linear-gradient(120deg, #2997ff, #a78bfa 55%, #ff6ba8); }

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; font: inherit; font-size: 17px; font-weight: 500; letter-spacing: -.01em;
  color: var(--accent-fg); background: var(--accent); border: 0; border-radius: 980px; cursor: pointer;
  transition: background .2s, transform .12s var(--ease), opacity .2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.sm { min-height: 34px; padding: 0 16px; font-size: 14px; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); filter: brightness(.96); }
.btn.block { width: 100%; }

/* Thẻ */
.card {
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  min-height: 230px; padding: 92px 28px 28px; color: var(--fg); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); text-decoration: none; }
.tile:active { transform: scale(.975); transition-duration: .1s; }
.tile .glyph {
  position: absolute; top: 24px; left: 28px; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 24px; color: #fff;
  background: linear-gradient(145deg, var(--g1, #5ac8fa), var(--g2, #0071e3));
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.tile h2 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 22px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.tile p { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .go { position: absolute; top: 28px; right: 28px; color: var(--fg-3); font-size: 18px; transition: transform .4s var(--ease), color .2s; }
.tile:hover .go { transform: translate(3px,-3px); color: var(--accent); }
.tile.feature { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }

.grid { display: grid; gap: 18px; grid-template-columns: 1fr; padding-bottom: 72px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Form */
label { display: block; font-size: 13px; font-weight: 500; color: var(--fg-2); margin: 0 0 6px; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--fg);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  transition: border-color .2s, box-shadow .2s; resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.alert { padding: 12px 16px; border-radius: var(--r-m); margin: 0 0 20px; font-size: 15px; border: 1px solid var(--line); background: var(--surface); }
.alert.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.alert.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.back { display: inline-block; margin: 28px 0 0; font-size: 15px; color: var(--accent); }
.page-title { font-size: clamp(32px, 6vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; margin: 14px 0 8px; }
.sub { margin: 0 0 32px; color: var(--fg-2); font-size: 19px; line-height: 1.4; }
.note { margin: 28px 0 0; font-size: 13px; color: var(--fg-3); }
.note a { color: var(--fg-3); text-decoration: underline; text-underline-offset: 2px; }
.footer { text-align: center; padding: 36px 22px 48px; font-size: 13px; color: var(--fg-3); border-top: 1px solid var(--line); }
.footer a { color: var(--fg-3); }
.grecaptcha-badge { visibility: visible; }

/* Nút đổi giao diện sáng/tối */
.theme-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--fg-2); cursor: pointer; font-size: 17px; transition: background .2s, transform .12s var(--ease); }
.theme-btn:hover { background: var(--accent-soft); color: var(--fg); }
.theme-btn:active { transform: scale(.9); }
.theme-btn.float { position: fixed; top: 14px; right: 14px; z-index: 60; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); }
.nav-r { display: flex; align-items: center; gap: 14px; }

/* Hiện dần khi cuộn / tải */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .tile:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --line: rgba(128,128,128,.6); --fg-2: var(--fg); } }
