/* AIVL – trang thông tin công khai: /privacy.html · /terms.html · /support.html
   (cms/public → cms/dist, Express phục vụ ở gốc tên miền). CSS thuần: không font, script hay CDN bên ngoài.
   Màu theo docs/AIVL-BRAND.md. Giao diện sáng, hiển thị tốt từ màn hình 360px. */

:root {
  --primary: #1660c9;
  --primary-600: #1253b0;
  --primary-700: #0e4593;
  --primary-50: #eaf2fd;
  --primary-100: #d3e3fa;
  --dark: #0b2547;
  --dark-2: #10305a;
  --dark-text: #b7c8e0;
  --sky: #9cd3ff;
  --text: #0f1b2d;
  --text-2: #475569;
  --text-3: #7a8699;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #e5484d;
  --accent-600: #c93a40;
  --accent-50: #fdecec;
  --success: #15803d;
  --success-700: #166534;
  --success-50: #e8f6ed;
  --amber: #b45309;
  --amber-50: #fef3e2;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 6px 20px rgba(15, 27, 45, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img {
  max-width: 100%;
}
a {
  color: var(--primary);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--primary-700);
}
:focus-visible {
  outline: 3px solid rgba(22, 96, 201, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}
strong,
b {
  font-weight: 700;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}
.wrap-wide {
  max-width: 1100px;
}
@media (min-width: 640px) {
  .wrap {
    padding: 0 24px;
  }
}

/* ---------------------------------------------------------------- header */
.site-header {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 62%, #13396a 100%);
  color: #fff;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: none;
  display: block;
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.brand-name small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--dark-text);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  color: var(--dark-text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.site-nav a[aria-current='page'] {
  color: #fff;
  background: var(--primary);
}
@media (max-width: 559px) {
  .site-nav {
    width: 100%;
  }
  .site-nav a {
    flex: 1 1 0;
    text-align: center;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.07);
  }
}

.hero {
  padding-top: 22px;
  padding-bottom: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sky);
}
.hero h1 {
  margin: 0;
  font-size: clamp(27px, 5vw, 38px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero-lead {
  margin: 10px 0 0;
  max-width: 640px;
  color: #dbe6f5;
  font-size: 16.5px;
}
.hero-meta {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--dark-text);
  font-size: 14.5px;
}
.hero-meta .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6eef9;
  white-space: nowrap;
}
.hero-meta a.pill {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.hero-meta a.pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------------------------------------------------------------- nội dung */
.main {
  margin-top: -40px;
  padding-bottom: 44px;
}
.doc,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}
.doc + .doc,
.card + .doc,
.support-grid + .doc {
  margin-top: 20px;
}
@media (min-width: 640px) {
  .doc {
    padding: 36px 44px;
  }
  .card {
    padding: 28px 32px;
  }
}
.doc > :first-child,
.card > :first-child,
.doc section > :first-child {
  margin-top: 0;
}
.doc > :last-child,
.card > :last-child {
  margin-bottom: 0;
}
.doc section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.doc h2,
.card h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.35;
  color: var(--dark);
  letter-spacing: -0.005em;
}
.doc h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
}
.doc p,
.card p {
  margin: 0 0 12px;
}
.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.doc li {
  margin: 6px 0;
}
.doc li::marker {
  color: var(--primary);
  font-weight: 700;
}
.doc-head {
  margin-bottom: 8px;
}
.doc-head h2 {
  font-size: 25px;
  margin-bottom: 2px;
}
.lead {
  font-size: 17px;
  color: var(--text-2);
}
.muted {
  color: var(--text-3);
}
.small {
  font-size: 14px;
}
.nowrap {
  white-space: nowrap;
}
.ui {
  display: inline-block;
  padding: 0 7px;
  border-radius: 6px;
  background: #eef2f7;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.93em;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--dark);
}
.to-top {
  display: inline-block;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* hộp nhấn mạnh */
.callout {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout ul {
  margin-bottom: 0;
}
.callout-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--dark);
}
.callout-info {
  background: var(--primary-50);
  border-color: var(--primary-100);
}
.callout-ok {
  background: var(--success-50);
  border-color: #c8ebd4;
}
.callout-ok .callout-title {
  color: var(--success-700);
}
.callout-warn {
  background: var(--amber-50);
  border-color: #f4d7a6;
}
.callout-warn .callout-title {
  color: var(--amber);
}
.callout-danger {
  background: var(--accent-50);
  border-color: #f6c3c5;
}
.callout-danger .callout-title {
  color: var(--accent-600);
}

/* mục lục */
.toc {
  margin: 20px 0 4px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toc-title {
  margin: 0 0 6px !important;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.toc ol {
  margin: 0;
  padding-left: 22px;
  font-size: 15px;
}
.toc li {
  margin: 0;
  padding: 3px 0;
  break-inside: avoid;
}
.toc a {
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}
@media (min-width: 720px) {
  .toc ol {
    columns: 2;
    column-gap: 36px;
  }
}

/* danh sách nhóm dữ liệu / quyền truy cập */
.dl {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}
.dl > div {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dl dt {
  margin-bottom: 2px;
  font-weight: 700;
  color: var(--dark);
}
.dl dd {
  margin: 0;
  color: var(--text-2);
}
@media (min-width: 720px) {
  .dl.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  .dl.cols-2 > .full {
    grid-column: 1 / -1;
  }
}

/* bước thao tác */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 38px;
  margin: 10px 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}

/* ---------------------------------------------------------------- trang hỗ trợ */
.support-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 960px) {
  .support-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
  }
}
.card-head {
  margin-bottom: 18px;
}
.card-head h2 {
  margin-bottom: 4px;
}
.card-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

.form {
  display: grid;
  gap: 18px;
}
.form-row {
  display: grid;
  gap: 18px;
}
@media (min-width: 560px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}
.field > label,
.field-label {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text);
}
.req {
  color: var(--accent);
  margin-left: 2px;
}
.opt {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-3);
}
.hint {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-3);
}
.input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input::placeholder {
  color: #9aa6b8;
}
.input:hover {
  border-color: #b3c0d1;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 96, 201, 0.18);
}
textarea.input {
  min-height: 150px;
  resize: vertical;
}
select.input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field.invalid .input,
.form-row.invalid .input {
  border-color: var(--accent);
}
.field.invalid .input:focus,
.form-row.invalid .input:focus {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}
.field-error {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-600);
}
.field-error:empty {
  display: none;
}
.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.counter {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.topic-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-50);
  border: 1px solid #f4d7a6;
  color: #7c3d06;
  font-size: 14px;
  line-height: 1.5;
}
.topic-note[hidden] {
  display: none;
}
.topic-note span[lang='en'] {
  display: block;
  margin-top: 4px;
  opacity: 0.85;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--primary-600);
}
.btn:disabled {
  opacity: 0.7;
  cursor: progress;
}
.btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn[aria-busy='true'] .spinner {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 559px) {
  .btn {
    width: 100%;
  }
}
.form-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
  font-weight: 600;
  line-height: 1.5;
}
.form-status:focus {
  outline: none;
}
.form-status[hidden] {
  display: none;
}
.form-status.ok {
  background: var(--success-50);
  border-color: #c8ebd4;
  color: var(--success-700);
}
.form-status.err {
  background: var(--accent-50);
  border-color: #f6c3c5;
  color: var(--accent-600);
}
.form-status .sub {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: 14px;
  opacity: 0.9;
}
.noscript {
  margin: 0 0 16px;
}
/* bẫy bot: ẩn khỏi màn hình nhưng vẫn nằm trong form */
.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* cột phụ */
.aside {
  display: grid;
  gap: 20px;
}
.aside h2 {
  font-size: 18px;
  margin-bottom: 12px;
}
.quick {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.quick a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  line-height: 1.45;
}
.quick a:hover {
  border-color: var(--primary-100);
  background: var(--primary-50);
}
.quick b {
  display: block;
  color: var(--dark);
}
.quick span {
  font-size: 14px;
  color: var(--text-2);
}
.app-tip {
  background: var(--primary-50);
  border-color: var(--primary-100);
}
.app-tip p {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
}
.app-tip h2 {
  color: var(--primary-700);
}

/* câu hỏi thường gặp */
.faq {
  display: grid;
  gap: 10px;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.faq details[open] {
  border-color: var(--primary-100);
  background: #fbfdff;
}
.faq summary {
  position: relative;
  padding: 14px 46px 14px 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--dark);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s;
}
.faq details[open] > summary::after {
  transform: translateY(-25%) rotate(-135deg);
}
.faq .answer {
  padding: 0 16px 14px;
  color: var(--text-2);
}
.faq .answer > :last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 14px;
  padding: 20px 0 28px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}
.site-footer p {
  margin: 0;
}
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.foot-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}
.foot-nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media print {
  .skip,
  .site-nav,
  .toc,
  .hero-meta a,
  .to-top,
  .support-grid,
  .foot-nav {
    display: none !important;
  }
  body,
  .site-header {
    background: #fff !important;
    color: #000;
  }
  .brand,
  .hero h1 {
    color: #000;
  }
  .hero {
    padding-bottom: 12px;
  }
  .main {
    margin-top: 0;
  }
  .doc,
  .card {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
}
