/* Golden Field – design tokens & thành phần dùng chung */
:root {
  --navy-950: #0b1830;
  --navy-900: #10213f;
  --navy-800: #182d55;
  --navy-700: #22396a;
  --navy-100: #e6ebf5;
  --gold-600: #a8841a;
  --gold-500: #c9a227;
  --gold-400: #dcb94b;
  --gold-100: #f7eecf;
  --gold-50: #fcf8ea;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #182033;
  --text-2: #3d475c;
  --muted: #677189;
  --border: #e2e6ee;
  --border-strong: #cfd5e1;

  --red-600: #c62828;
  --red-50: #fdecec;
  --amber-600: #b45309;
  --amber-50: #fff5e0;
  --green-600: #0f7a4f;
  --green-50: #e7f6ee;
  --blue-600: #2563eb;
  --blue-50: #e8f0fe;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 63, .06);
  --shadow: 0 2px 6px rgba(16, 33, 63, .06), 0 8px 24px rgba(16, 33, 63, .06);
  --shadow-lg: 0 20px 50px rgba(16, 33, 63, .18);
  --focus: 0 0 0 3px rgba(201, 162, 39, .45);

  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html[data-fontsize="lg"] { font-size: 112.5%; }
html[data-fontsize="xl"] { font-size: 125%; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-700); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; color: var(--navy-900); }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: .95rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-800); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--navy-100); color: var(--navy-900); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #a61e1e; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .875rem; border-radius: 8px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn-block { width: 100%; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge .icon { width: .95em; height: .95em; }
.badge-urgent { background: var(--red-600); color: #fff; }
.badge-important { background: var(--amber-50); color: var(--amber-600); }
.badge-pinned { background: var(--gold-100); color: var(--gold-600); }
.badge-new { background: var(--blue-50); color: var(--blue-600); }
.badge-muted { background: #eef0f5; color: var(--muted); }
.badge-green { background: var(--green-50); color: var(--green-600); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field + .field { margin-top: 1rem; }
.label { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--focus); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .input { padding-left: 2.4rem; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950); font-weight: 800; font-size: 1rem; letter-spacing: -.02em;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 1.05rem; font-weight: 700; }
.logo-text span { font-size: .75rem; opacity: .75; }

/* ---------- Article content (dùng chung giữa trang cư dân & xem trước) ---------- */
.prose { font-size: 1.05rem; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1em; }
.prose p { margin: 0; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; }
.prose ul, .prose ol { margin: 0; padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose blockquote {
  margin: 1.2em 0 0; padding: .9rem 1.1rem; border-left: 4px solid var(--gold-500);
  background: var(--gold-50); border-radius: 0 10px 10px 0; color: var(--text-2);
}
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .75rem; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose a { color: var(--blue-600); }
.prose hr { border: 0; border-top: 1px solid var(--border); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 24, 48, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease-out;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  animation: pop .18s ease-out;
}
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.1rem; }
.modal-body { padding: 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
.toast {
  display: flex; align-items: center; gap: .6rem;
  background: var(--navy-900); color: #fff; padding: .75rem 1rem; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: .95rem; animation: rise .2s ease-out; pointer-events: auto;
}
.toast .icon { color: var(--gold-400); }
.toast.error .icon { color: #ff8a8a; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
