/* =====================================================================
 * styles.css – static stylesheet (thay cho Tailwind CDN)
 * Tên class giữ nguyên theo quy ước Tailwind để HTML/JS không đổi.
 * ===================================================================== */

:root {
  --canvas: #eef0f3;
  --ink: #1a2230;
  --muted: #667085;
  --line: #dfe3ea;
  --lcp: #e29e32;
  --lcp-soft: #fdf3e3;
  --lcp-deep: #b97a17;
  --dg: #8a5a14;
  --dg-soft: #f4ece0;
  --dg-deep: #6d470f;
  --ok: #1f8a4c;
  --ok-soft: #e6f4ec;
  --bad: #c2362b;
  --bad-soft: #fbeae8;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
*, ::before, ::after { box-sizing: border-box; border: 0 solid var(--line); }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; }
body { margin: 0; line-height: inherit; }
h1, h2, h3, p { margin: 0; font-size: inherit; font-weight: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
fieldset { margin: 0; padding: 0; min-width: 0; }
a { color: inherit; text-decoration: inherit; }
button, input, select { font: inherit; color: inherit; margin: 0; }
button { background: transparent; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.place-items-center { place-items: center; }

.gap-1 { gap: .25rem; }
.gap-1\.5 { gap: .375rem; }
.gap-2 { gap: .5rem; }
.gap-2\.5 { gap: .625rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-y-0 { top: 0; bottom: 0; }
.top-2 { top: .5rem; }
.top-4 { top: 1rem; }
.right-2 { right: .5rem; }
.right-4 { right: 1rem; }
.left-0 { left: 0; }
.left-4 { left: 1rem; }
.z-50 { z-index: 50; }

.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ---------- Sizing ---------- */
.w-1 { width: .25rem; }
.w-1\.5 { width: .375rem; }
.w-2\.5 { width: .625rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-full { width: 100%; }
.h-1\.5 { height: .375rem; }
.h-2\.5 { height: .625rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-11 { height: 2.75rem; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.min-w-\[150px\] { min-width: 150px; }
.max-w-6xl { max-width: 72rem; }
.max-w-\[220px\] { max-width: 220px; }
.max-w-\[420px\] { max-width: 420px; }
.max-h-\[520px\] { max-height: 520px; }

/* ---------- Spacing ---------- */
.mx-auto { margin-left: auto; margin-right: auto; }
.mr-auto { margin-right: auto; }
.mt-0\.5 { margin-top: .125rem; }
.mt-1 { margin-top: .25rem; }
.mt-1\.5 { margin-top: .375rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }

.p-5 { padding: 1.25rem; }
.px-1\.5 { padding-left: .375rem; padding-right: .375rem; }
.px-2\.5 { padding-left: .625rem; padding-right: .625rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-3\.5 { padding-left: .875rem; padding-right: .875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-0\.5 { padding-top: .125rem; padding-bottom: .125rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-3 { padding-bottom: .75rem; }
.pb-5 { padding-bottom: 1.25rem; }
.pl-4 { padding-left: 1rem; }
.pr-10 { padding-right: 2.5rem; }

/* ---------- Typography ---------- */
.font-sans { font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-\[15px\] { font-size: 15px; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all { word-break: break-all; }

.text-ink { color: var(--ink); }
.text-muted { color: var(--muted); }
.text-white { color: #fff; }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }
.text-lcp-deep { color: var(--lcp-deep); }
.text-dg-deep { color: var(--dg-deep); }

/* ---------- Backgrounds ---------- */
.bg-canvas { background-color: var(--canvas); }
.bg-white { background-color: #fff; }
.bg-slate-50\/60 { background-color: rgb(248 250 252 / .6); }
.bg-slate-100 { background-color: var(--slate-100); }
.bg-slate-300 { background-color: var(--slate-300); }
.bg-slate-400 { background-color: var(--slate-400); }
.bg-lcp { background-color: var(--lcp); }
.bg-lcp-soft { background-color: var(--lcp-soft); }
.bg-dg { background-color: var(--dg); }
.bg-dg-soft { background-color: var(--dg-soft); }
.bg-ok { background-color: var(--ok); }
.bg-ok-soft { background-color: var(--ok-soft); }
.bg-bad { background-color: var(--bad); }

/* ---------- Borders & radius ---------- */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-line { border-color: var(--line); }
.divide-y > * + * { border-top-width: 1px; }
.divide-line > * + * { border-color: var(--line); }
.rounded { border-radius: .25rem; }
.rounded-md { border-radius: .375rem; }
.rounded-xl { border-radius: .75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-b-2xl { border-bottom-left-radius: 1rem; border-bottom-right-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ---------- Effects ---------- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
.transition {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-timing-function: var(--ease);
  transition-duration: 150ms;
}
.duration-200 { transition-duration: 200ms; }
.opacity-0 { opacity: 0; }
.translate-y-1 { transform: translateY(.25rem); }
.animate-pulse { animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Misc ---------- */
.cursor-pointer { cursor: pointer; }
.select-none { -webkit-user-select: none; user-select: none; }
.accent-lcp { accent-color: var(--lcp); }
.accent-dg { accent-color: var(--dg); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ---------- States ---------- */
.hover\:bg-slate-100:hover { background-color: var(--slate-100); }
.hover\:text-ink:hover { color: var(--ink); }
.hover\:border-lcp:hover { border-color: var(--lcp); }

.peer:checked ~ .peer-checked\:bg-lcp-soft { background-color: var(--lcp-soft); }
.peer:checked ~ .peer-checked\:border-lcp { border-color: var(--lcp); }
.peer:checked ~ .peer-checked\:text-lcp-deep { color: var(--lcp-deep); }
.peer:checked ~ .peer-checked\:font-semibold { font-weight: 600; }
.peer:focus-visible ~ .peer-focus-visible\:ring-4 { box-shadow: 0 0 0 4px rgb(226 158 50 / .25); }

/* Khối hệ thống: viền đổi màu khi được tick */
.sys-block { border-width: 1px; border-color: var(--line); border-radius: .75rem; transition: border-color 150ms var(--ease); }
.sys-block-lcp:has(#sys-lcp:checked) { border-color: var(--lcp); }
.sys-block-dg:has(#sys-dg:checked) { border-color: var(--dg); }

/* ---------- Components ---------- */
.label { display: block; font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--ink); margin-bottom: .375rem; }
.req { color: var(--bad); margin-left: .125rem; }

.input {
  width: 100%; height: 2.5rem; padding: 0 .75rem;
  border: 1px solid var(--line); border-radius: .5rem; background: #fff;
  font-size: 15px; color: var(--ink);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.input::placeholder { color: var(--slate-400); opacity: 1; }
.input:focus { outline: none; border-color: var(--lcp); box-shadow: 0 0 0 4px rgb(226 158 50 / .2); }
.input:disabled { background: var(--slate-50); color: var(--slate-400); }
.input.pr-10 { padding-right: 2.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.5rem; padding: 0 1rem; border-radius: .5rem;
  font-size: .875rem; line-height: 1.25rem; font-weight: 600;
  transition: background-color 150ms var(--ease), box-shadow 150ms var(--ease), color 150ms var(--ease);
}
.btn:focus-visible { outline: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.h-9 { height: 2.25rem; }
.btn.h-11 { height: 2.75rem; }
.btn.px-3 { padding-left: .75rem; padding-right: .75rem; }
.btn-primary { background: var(--lcp); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--lcp-deep); }
.btn-primary:focus-visible { box-shadow: 0 0 0 4px rgb(226 158 50 / .3); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--slate-50); }
.btn-ghost:focus-visible { box-shadow: 0 0 0 4px var(--slate-300); }

.link-action { font-size: .875rem; font-weight: 500; color: var(--lcp-deep); }
.link-action:hover, .link-action:focus-visible { text-decoration: underline; outline: none; }

.eye {
  position: absolute; top: 0; bottom: 0; right: 0; width: 2.5rem;
  display: grid; place-items: center; color: var(--muted);
}
.eye:hover, .eye:focus-visible { color: var(--ink); outline: none; }

/* Chuỗi input.h-5 / h-4 trong checkbox */
input[type="checkbox"] { flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .sm\:left-auto { left: auto; }
  .sm\:w-\[380px\] { width: 380px; }
  .sm\:max-w-\[200px\] { max-width: 200px; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .layout-main { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
