/* hoclieupiano – giao diện chung. Màu, nút, ô nhập, hộp thoại chép từ Say Piano Gia sư (giasu.css) để hai chương trình đồng bộ thương hiệu.
 * Phần riêng: mindmap quản trị (.mm-*), bảng sửa khối (.bs-*), phòng học (.ph-*). */
@font-face { font-family: "Lilita One Viet"; src: url("../fonts/LilitaOne-Viet.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("../fonts/Quicksand-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("../fonts/Quicksand-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("../fonts/Quicksand-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sm-dem: #2A0A7E; --sm-khoi: #5B2BC4; --sm-hong: #FF5FAE; --sm-hong-kem: #FFE3E6; --sm-vang: #FFC928;
  --sm-cam: #FF8A00; --sm-ngoc: #22AEFF; --sm-oai: #F1E9FF;
  --sm-hong-dam: #D92B83; --sm-hong-sau: #C2186F; --sm-vang-chu: #7A5600; --sm-vang-nhat: #FFF6D6; --sm-ngoc-chu: #0A68AD;

  --nen: #F7F5FA; --mat: #FFFFFF; --mat-2: #FAF8FD; --vien: rgba(42, 10, 126, .10); --vien-dam: rgba(42, 10, 126, .2);
  --chu: #1E1236; --chu-2: rgba(30, 18, 54, .70); --chu-3: rgba(30, 18, 54, .52);
  --tieu-de: var(--sm-dem); --nhan: var(--sm-khoi); --nhan-nhat: rgba(91, 43, 196, .10);
  --cta: var(--sm-hong-dam); --cta-hover: var(--sm-hong-sau); --lien-ket: var(--sm-ngoc-chu);
  --tot: #1E7A3C; --tot-nen: rgba(52, 199, 89, .14); --canh-bao: #9A4306; --canh-bao-nen: #FFF1E0;
  --loi: #C0123C; --loi-nen: #FFE3E6;
  --bong: 0 1px 2px rgba(42, 10, 126, .05), 0 6px 20px rgba(42, 10, 126, .06);
  --r: 18px; --r-sm: 12px;
  --chu-de: "Lilita One Viet", "Quicksand", system-ui, sans-serif;
  --chu-than: "Quicksand", -apple-system, system-ui, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nen: #0F0B1A; --mat: #1B1628; --mat-2: #221C32; --vien: rgba(241, 233, 255, .10); --vien-dam: rgba(241, 233, 255, .2);
    --chu: #F4EFFF; --chu-2: rgba(244, 239, 255, .72); --chu-3: rgba(244, 239, 255, .5);
    --tieu-de: #F1E9FF; --nhan: #B9A6F0; --nhan-nhat: rgba(185, 166, 240, .14); --lien-ket: #8FD6FF;
    --tot: #5EDB86; --tot-nen: rgba(48, 209, 88, .16); --canh-bao: #FFB13B; --canh-bao-nen: rgba(255, 138, 0, .16);
    --loi: #FF8FA8; --loi-nen: rgba(255, 95, 174, .14); --sm-vang-nhat: rgba(255, 201, 40, .14); --sm-vang-chu: #FFE07A;
    --bong: 0 0 0 .5px rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 500 16px/1.55 var(--chu-than); color: var(--chu); background: var(--nen); -webkit-font-smoothing: antialiased; }
a { color: var(--lien-ket); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--chu-de); font-weight: 400; color: var(--tieu-de); letter-spacing: .005em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 18px; }
p { text-wrap: pretty; }
.mo { color: var(--chu-3); }
.phu { color: var(--chu-2); }
.an { display: none !important; }
:focus-visible { outline: 3px solid rgba(91, 43, 196, .45); outline-offset: 2px; border-radius: 8px; }

/* ---------- thanh trên ---------- */
.dau { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--nen) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); border-bottom: .5px solid var(--vien); }
.dau__trong { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.dau__logo { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.dau__logo img { height: 34px; width: auto; display: block; }
.dau__nhan { font: 400 15px var(--chu-de); color: var(--sm-dem); background: var(--sm-oai); padding: 3px 10px; border-radius: 999px; }
.dau__menu { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.dau__menu a { color: var(--chu-2); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.dau__menu a:hover { background: var(--nhan-nhat); text-decoration: none; color: var(--tieu-de); }
.dau__menu a.dang-o { color: var(--tieu-de); background: var(--nhan-nhat); }
.dau__logo img.logo-trang { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dau__logo img.logo-mau { display: none; }
  :root:not([data-theme="light"]) .dau__logo img.logo-trang { display: block; }
}

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- nút: một hệ duy nhất ---------- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1.5px solid var(--vien-dam); background: var(--mat); color: var(--nhan); font: 400 17px var(--chu-de); letter-spacing: .01em;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, transform .05s; }
.nut:hover { background: var(--nhan-nhat); }
.nut:active { transform: translateY(1px); }
.nut[disabled] { opacity: .5; cursor: not-allowed; }
.nut--chinh { background: var(--cta); border-color: var(--cta); color: #fff; }
.nut--chinh:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.nut--nhe { border-color: transparent; background: transparent; }
.nut--nho { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.nut--rong { width: 100%; }
.nut--nguy { color: var(--loi); }

/* ---------- ô nhập ---------- */
.o { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--vien-dam); background: var(--mat); font-weight: 600; }
textarea.o { min-height: 96px; resize: vertical; line-height: 1.5; }
.nhan-o { display: block; font-weight: 700; font-size: 14px; color: var(--chu-2); margin: 14px 0 6px; }
.goi-y { font-size: 13px; color: var(--chu-3); margin-top: 4px; }

/* ---------- thẻ ---------- */
.the { background: var(--mat); border-radius: var(--r); box-shadow: var(--bong); border: .5px solid var(--vien); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--nhan-nhat); color: var(--nhan); white-space: nowrap; }
.chip--vang { background: var(--sm-vang-nhat); color: var(--sm-vang-chu); }
.chip--tot { background: var(--tot-nen); color: var(--tot); }
.chip--canh-bao { background: var(--canh-bao-nen); color: var(--canh-bao); }
.chip--loi { background: var(--loi-nen); color: var(--loi); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- hộp thoại ---------- */
dialog.hop { border: 0; padding: 0; border-radius: 22px; width: min(520px, calc(100vw - 32px)); background: var(--mat); color: var(--chu);
  box-shadow: 0 24px 80px rgba(20, 0, 60, .35); }
dialog.hop::backdrop { background: rgba(20, 8, 50, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.hop__than { padding: 24px; max-height: calc(100vh - 80px); overflow: auto; }
.hop__than h2 { margin-bottom: 6px; }
.hop__nut { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.thong-bao-loi { color: var(--loi); font-weight: 700; min-height: 1.4em; margin: 8px 0 0; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 80px; }
.bang-trong { text-align: center; padding: 48px 16px; color: var(--chu-2); }
.bang-trong h2 { margin-bottom: 8px; }

.loading { display: flex; justify-content: center; padding: 60px; }
.loading::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--nhan-nhat); border-top-color: var(--nhan); animation: quay .8s linear infinite; }
@keyframes quay { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--sm-dem); color: #fff; padding: 12px 18px;
  border-radius: 14px; font-weight: 700; z-index: 100; transition: .25s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.hien { opacity: 1; transform: translate(-50%, 0); }
.chan { text-align: center; color: var(--chu-3); font-size: 13px; padding: 28px 16px 40px; }

.bang-trong { text-align: center; padding: 48px 16px; color: var(--chu-2); }
.van-ban { white-space: pre-line; }

/* ---------- trang chủ ---------- */
.gioi-thieu { max-width: 720px; margin: 48px auto; text-align: center; display: grid; gap: 16px; justify-items: center; }
.gioi-thieu .phu { font-size: 18px; }
.tieu-de-trang { margin: 12px 0 20px; }
.khu { margin: 28px 0; }
.khu > h2 { margin-bottom: 12px; }
.luoi-gt { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.gt { padding: 0; overflow: hidden; }
.gt summary { list-style: none; cursor: pointer; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.gt summary::-webkit-details-marker { display: none; }
.gt summary .mo { grid-column: 2; font-size: 14px; }
.gt__nhan { grid-row: span 2; font: 400 15px var(--chu-de); color: #fff; background: var(--nhan); border-radius: 12px; padding: 10px 12px; text-align: center; min-width: 76px; }
.gt__ten { font: 400 19px var(--chu-de); color: var(--tieu-de); }
.ds-bai { list-style: none; margin: 0; padding: 4px 8px 12px; border-top: .5px solid var(--vien); max-height: 420px; overflow: auto; }
.ds-bai li { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; }
.ds-bai li:hover { background: var(--mat-2); }
.ds-bai__so { color: var(--chu-3); font-weight: 700; font-size: 13px; }
.ds-bai__ten { color: var(--chu); font-weight: 600; }
.ds-phong { display: flex; flex-wrap: wrap; gap: 10px; }
.the-phong { display: grid; gap: 2px; padding: 14px 16px; background: var(--mat); border: .5px solid var(--vien); border-radius: var(--r-sm); color: var(--chu); min-width: 200px; }
.the-phong:hover { text-decoration: none; border-color: var(--nhan); }
.the-phong .chip { justify-self: start; margin-top: 6px; }
@media (max-width: 600px) {
  .luoi-gt { grid-template-columns: 1fr; }
  .dau__trong { gap: 8px; }
  .dau__nhan { white-space: nowrap; font-size: 13px; }
  .dau__menu { flex-wrap: nowrap; overflow-x: auto; gap: 0; }
  .dau__menu a { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
}
