/* =========================================================
   SVIB — nền tảng giao diện dùng chung (index.html, 404.html)
   Chỉ giao diện tối · không bo góc · không đổ bóng
   ========================================================= */

:root {
  color-scheme: dark;

  /* Màu */
  --bg: #050607;          /* nền gần đen */
  --bg-raise: #0b0d0f;    /* bề mặt nổi nhẹ */
  --text: #eef0f2;        /* chữ trắng ngà */
  --muted: #8b939c;       /* chữ phụ xám  (6.5:1 trên nền) */
  --dim: #737b84;         /* chữ mờ nhất vẫn đạt AA (4.7:1) */
  --line: #24282d;        /* đường kẻ mảnh */
  --line-strong: #3a4047; /* gạch chân ô nhập, viền phụ */
  --error: #ff8a4c;       /* lỗi màu cam */
  --ok: #3ddc84;          /* chấm trạng thái xanh */
  --glow: 150 185 255;    /* ánh chân trời (rgb) */

  /* Chữ */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Bố cục */
  --gutter: clamp(16px, 5vw, 56px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip; /* lưới an toàn: không bao giờ có thanh cuộn ngang */
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

a { color: inherit; text-underline-offset: .25em; text-decoration-thickness: 1px; }

::selection { background: var(--text); color: var(--bg); }

/* ---------- Tiện ích ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.12; /* chừa chỗ cho dấu tiếng Việt chồng trên chữ in hoa */
}

/* ---------- Bỏ qua tới nội dung ---------- */
.skip {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--text);
  color: var(--bg);
  font: 500 13px/1 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Viền focus rõ ràng khi dùng bàn phím ---------- */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Nút: viền mảnh, in hoa, giãn chữ, hover đảo màu ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
  min-height: 48px;
  padding: 0 26px 0 calc(26px + .24em); /* bù khoảng giãn chữ ký tự cuối */
  border: 1px solid var(--text);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn--ghost { border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { min-height: 40px; padding: 0 18px 0 calc(18px + .24em); font-size: 12px; }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: .32; cursor: not-allowed; }
.btn[disabled]:hover,
.btn[aria-disabled="true"]:hover { background: transparent; color: var(--text); }

/* ---------- Ô nhập: chỉ có gạch chân ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field__label,
.legend {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
}
.req { color: var(--text); }

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.45;
  transition: border-color .2s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-bottom-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-bottom-color: var(--text); }
.input::placeholder, .textarea::placeholder { color: #6f777f; opacity: 1; }
.textarea { min-height: 96px; resize: vertical; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b939c' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.select option { background: var(--bg-raise); color: var(--text); }
.input[type="date"] { min-height: 49px; }
.input[type="date"]::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }

[aria-invalid="true"] { border-bottom-color: var(--error) !important; }
.error {
  margin: 2px 0 0;
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
}
.error[hidden] { display: none; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

/* ---------- Tôn trọng prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
