/* Vườn hoa tri ân 20/11 — trang riêng, cùng bộ nhận diện tramhocnoi.vn */
:root {
  --maroon: #5A1608;
  --maroon-2: #7C2810;
  --orange: #EE7418;
  --orange-2: #FF9B3D;
  --amber: #FFC163;
  --cream: #FFF6EA;
  --cream-2: #FCEAD3;
  --paper: #FFFDF9;
  --ink: #2A0C05;
  --ink-2: #5B3A30;
  --line: rgba(90, 22, 8, .14);
  --grad-dark: radial-gradient(120% 140% at 85% 0%, #C2501A 0%, #8A2C0D 38%, #4A1006 75%, #2E0903 100%);
  --radius: 20px;
  --shadow: 0 18px 40px -18px rgba(90, 22, 8, .35);
  --display: 'Montserrat', 'Be Vietnam Pro', sans-serif;
  --body: 'Be Vietnam Pro', system-ui, sans-serif;
  --script: 'Dancing Script', cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--cream); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); color: var(--maroon); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Nút */
.btn { white-space: nowrap; font: 700 1rem/1.2 var(--display); border: 0; border-radius: 999px; padding: 14px 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; min-height: 48px; }
.btn:focus-visible, .chip:focus-visible, .seg:focus-visible, .ctl:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 22px -10px rgba(238, 116, 24, .8); }
.btn-primary:hover { background: #DD6410; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .65; cursor: progress; transform: none; }
.btn-ghost { background: transparent; color: var(--maroon); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--orange); color: var(--orange); }
.btn-light { background: #fff; color: var(--maroon); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45); }
.btn-sm { padding: 10px 18px; font-size: .92rem; min-height: 42px; }
.btn-lg { padding: 17px 32px; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* Thanh đầu trang */
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 246, 234, .88); backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; height: 70px; }
.brand img { height: 46px; width: auto; }
.event-name { font: 700 1.5rem/1 var(--script); color: var(--orange); white-space: nowrap; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-radius: 999px; }
.nav a:hover { background: var(--cream-2); color: var(--maroon); }

/* Mở đầu */
.hero { position: relative; overflow: hidden; background: var(--grad-dark); color: #fff; padding: clamp(64px, 10vw, 130px) 0 clamp(70px, 10vw, 130px); text-align: center; }
.hero-glow { position: absolute; inset: auto -20% -60% -20%; height: 120%; background: radial-gradient(closest-side, rgba(255, 193, 99, .38), transparent 70%); pointer-events: none; }
.hero-petals { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-in { position: relative; }
.eyebrow { font: 800 .82rem/1.4 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin: 0 0 20px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5.6vw, 3.9rem); font-weight: 900; margin-bottom: 22px; }
.hero h1 span { font-family: var(--script); font-weight: 700; color: var(--amber); font-size: 1.12em; letter-spacing: 0; }
.hero .lead { font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: rgba(255,255,255,.88); max-width: 40em; margin: 0 auto 34px; }
.hero .note { margin: 22px 0 0; color: rgba(255,255,255,.7); font-size: .95rem; font-style: italic; }

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
.section-head p { color: var(--ink-2); margin: 0; font-size: 1.06rem; }

/* Thầy cô */
.teachers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.teacher { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 0 rgba(90,22,8,.04); transition: transform .25s, box-shadow .25s; }
.teacher:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
/* Khung 5:4 khớp tỉ lệ ảnh; bám mép trên để không cắt thêm phần đầu (nhiều ảnh gốc đã sát tóc, cần ảnh gốc chưa cắt) */
.t-photo { aspect-ratio: 5 / 4; background: linear-gradient(180deg, var(--cream-2), #F7DDBD); overflow: hidden; }
.t-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.t-photo .mono { display: grid; place-items: center; height: 100%; font: 800 2.4rem var(--display); color: var(--maroon); opacity: .5; }
.t-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.t-role { font: 700 .74rem/1.3 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.t-name { font: 800 1.12rem/1.3 var(--display); color: var(--maroon); margin: 4px 0 6px; }
.t-bio { font-size: .9rem; color: var(--ink-2); margin: 0 0 14px; flex: 1; }
.t-actions { display: grid; gap: 8px; }
.t-actions .btn { width: 100%; padding: 11px 14px; font-size: .9rem; min-height: 44px; }
.t-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--cream-2); color: var(--maroon); font-size: .8rem; }
.teacher.all { background: var(--grad-dark); color: #fff; border: 0; justify-content: center; text-align: center; }
.teacher.all .t-body { justify-content: center; align-items: center; padding: 28px 22px; }
.teacher.all .t-name { color: #fff; font-size: 1.4rem; }
.teacher.all .t-bio { color: rgba(255,255,255,.8); flex: 0; }
.teacher.all .t-role { color: var(--amber); }
.teacher.all .t-actions { width: 100%; }
.teacher.all .btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.teacher.all .t-count { background: rgba(255,255,255,.15); color: #fff; }

/* Vườn */
.garden-section { background: linear-gradient(180deg, var(--cream) 0%, #FBE6CC 100%); }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #fff; border: 2px dashed var(--orange); border-radius: 16px; padding: 12px 16px; margin-bottom: 18px; color: var(--ink-2); font-size: .94rem; }
.demo-tag { font: 800 .78rem var(--display); letter-spacing: .12em; background: var(--orange); color: #fff; border-radius: 6px; padding: 5px 9px; }
.demo-bar .btn { margin-left: auto; }
.garden-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search input { font: inherit; font-size: .95rem; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; min-width: 220px; background: #fff; min-height: 44px; }
.search input:focus { outline: none; border-color: var(--orange); }
.chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding: 2px; scrollbar-width: thin; }
.chip { font: 600 .88rem var(--body); white-space: nowrap; border: 0; background: #fff; color: var(--ink-2); border-radius: 999px; padding: 9px 14px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--maroon); color: #fff; box-shadow: none; }
.chip b { font-weight: 700; opacity: .7; margin-left: 4px; }
.view-toggle { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg { font: 600 .88rem var(--body); border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 36px; }
.seg[aria-pressed="true"] { background: var(--orange); color: #fff; }
.garden-wrap { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #FFF9F0 0%, #FCE7CB 60%, #F6D5AA 100%); box-shadow: inset 0 0 0 1px var(--line); }
.garden { display: block; width: 100%; height: 520px; cursor: default; touch-action: pan-y; }
.garden.hovering { cursor: pointer; }
.garden-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; color: var(--ink-2); }
.garden-more { text-align: center; margin-top: 16px; }
.garden-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }
.card-list { columns: 3 300px; column-gap: 18px; }
.card-list .wish-card { break-inside: avoid; margin: 0 0 18px; cursor: default; }

/* Thiệp */
.wish-card { position: relative; background: var(--paper); border-radius: 22px; padding: 30px 28px 26px; box-shadow: 0 30px 70px -30px rgba(42, 12, 5, .55); border: 1px solid var(--line); background-image: radial-gradient(120% 60% at 100% 0%, rgba(255, 193, 99, .22), transparent 60%); }
.wc-flower { width: 54px; height: 54px; margin-bottom: 10px; }
.wc-flower canvas { width: 100%; height: 100%; }
.wc-to { font: 700 .8rem/1.4 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--orange); margin: 0 0 10px; }
.wc-msg { font-size: 1.08rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 16px; color: var(--ink); }
.wc-from { font: 700 1.35rem/1.2 var(--script); color: var(--maroon); margin: 0; text-align: right; }
.wc-from::before { content: "— "; }
.wc-pending { display: inline-block; font: 600 .76rem var(--body); background: var(--cream-2); color: var(--maroon); border-radius: 999px; padding: 3px 10px; margin-left: 8px; letter-spacing: 0; text-transform: none; }
.x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream-2); color: var(--maroon); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.x:hover { background: var(--orange); color: #fff; }

dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: calc(100% - 24px); }
dialog::backdrop { background: rgba(42, 12, 5, .55); backdrop-filter: blur(3px); }
.card-dialog { width: min(560px, 100%); }
.card-dialog[open] .wish-card { animation: card-in .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes card-in { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.card-dialog .wish-card { max-height: calc(100dvh - 40px); overflow-y: auto; }

/* Biểu mẫu */
.sheet { width: min(560px, 100%); }
.send-form { position: relative; background: var(--paper); border-radius: 24px; padding: 30px 28px 22px; box-shadow: var(--shadow); max-height: calc(100dvh - 32px); overflow-y: auto; }
.send-form h2 { font-size: 1.5rem; margin-bottom: 18px; padding-right: 40px; }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field legend { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; color: var(--maroon); margin-bottom: 6px; padding: 0; }
.field i { font-style: normal; font-weight: 400; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 1rem; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; color: var(--ink); }
.field textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(238, 116, 24, .18); }
.counter.near b { color: var(--orange); }
.flower-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.flower-pick label { cursor: pointer; }
.flower-pick input { position: absolute; opacity: 0; pointer-events: none; }
.flower-pick span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); transition: .2s; }
.flower-pick canvas { width: 46px; height: 46px; }
.flower-pick input:checked + span { box-shadow: inset 0 0 0 3px var(--orange); background: #FFF3E3; transform: scale(1.05); }
.flower-pick input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-err { background: #FDE6DF; color: #8A1C08; border-radius: 12px; padding: 10px 14px; font-size: .94rem; }
.fine { font-size: .84rem; color: var(--ink-2); margin: 12px 0 0; text-align: center; }

/* Bay hoa sau khi gửi */
.flyer-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.flyer-layer .wish-card { position: fixed; left: 50%; top: 50%; width: min(460px, calc(100% - 32px)); transform: translate(-50%, -50%); }
.flyer-layer .wish-card .wc-msg { max-height: 40vh; overflow: hidden; }
.flyer-layer > canvas { position: fixed; left: 0; top: 0; }

/* Màn gom hoa / trình chiếu */
.stage { position: fixed; inset: 0; z-index: 80; background: var(--grad-dark); color: #fff; overflow: hidden; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-top { position: absolute; top: 20px; left: 24px; display: flex; align-items: center; gap: 14px; z-index: 2; }
.stage-top img { height: 52px; width: auto; }
.stage-top b { display: block; font: 700 1.6rem/1 var(--script); color: var(--amber); }
.stage-top span { font-size: .85rem; color: rgba(255,255,255,.75); }
.stage-status { position: absolute; left: 0; right: 0; top: 72%; text-align: center; font: 700 clamp(1.1rem, 2.4vw, 1.6rem) var(--script); color: rgba(255,255,255,.9); margin: 0; z-index: 2; transition: opacity .6s; }
.stage-msg { position: absolute; left: 0; right: 0; bottom: max(78px, 8vh); text-align: center; padding: 0 20px; z-index: 2; animation: rise 1.2s ease both; }
.stage-msg h2 { color: #fff; font-size: clamp(1.5rem, min(4vw, 5.4vh), 3.2rem); font-weight: 900; text-shadow: 0 4px 30px rgba(0,0,0,.35); }
.stage-msg p { color: rgba(255,255,255,.85); margin: 0 0 6px; font-size: clamp(1rem, 1.6vw, 1.2rem); }
.stage-msg .stage-count { font: 700 1.3rem var(--script); color: var(--amber); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.stage-ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); z-index: 3; }
.stage .js-exit { position: fixed; top: 20px; right: 20px; }
.stage.returning .stage-top, .stage.returning .js-exit { opacity: 0; transition: opacity .4s; }
.show-ctrl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.25); padding: 8px 12px; border-radius: 999px; }
.ctl { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.2rem; cursor: pointer; }
.ctl:hover { background: rgba(255,255,255,.26); }
.ctl-speed { font-size: .88rem; color: rgba(255,255,255,.85); }
.ctl-speed input { width: 54px; font: inherit; border: 0; border-radius: 8px; padding: 6px; text-align: center; margin: 0 4px; }
.slide-count { font-size: .88rem; color: rgba(255,255,255,.7); min-width: 60px; text-align: center; }
.slide { position: absolute; inset: 100px 6vw 110px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; z-index: 2; }
.slide.enter { animation: rise .7s ease both; }
.slide-to { display: flex; align-items: center; gap: 14px; margin-bottom: 3vh; }
.slide-to img { width: clamp(64px, 8vw, 110px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center 18%; border: 3px solid var(--amber); background: var(--cream-2); }
.slide-to div { text-align: left; }
.slide-role { display: block; font: 700 clamp(.8rem, 1.2vw, 1rem) var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.slide-name { font: 800 clamp(1.3rem, 2.6vw, 2.2rem)/1.2 var(--display); color: #fff; }
.slide-msg { font-size: clamp(1.4rem, 3.2vw, 2.7rem); line-height: 1.45; max-width: 26em; margin: 0 0 3vh; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; }
.slide-msg.long { font-size: clamp(1.15rem, 2.3vw, 2rem); }
.slide-from { font: 700 clamp(1.6rem, 3vw, 2.6rem) var(--script); color: var(--amber); margin: 0; }
.slide-from::before { content: "— "; }
.slide-page { font-size: .9rem; color: rgba(255,255,255,.6); margin: 1.4vh 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--maroon); color: #fff; padding: 14px 22px; border-radius: 16px; font-size: .96rem; opacity: 0; pointer-events: none; transition: .3s; z-index: 90; width: max-content; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { background: var(--maroon); color: rgba(255,255,255,.85); text-align: center; padding: 48px 0 56px; }
.foot img { height: 56px; width: auto; margin: 0 auto 12px; }
.foot p { margin: 0 0 6px; font-family: var(--script); font-size: 1.5rem; color: var(--amber); }
.foot .small { font-family: var(--body); font-size: .88rem; color: rgba(255,255,255,.7); }

@media (max-width: 1020px) { .teachers { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .nav { display: none; }
  .top-in { height: 62px; gap: 12px; }
  .brand img { height: 38px; }
  .event-name { font-size: 1.25rem; }
  .top .btn { margin-left: auto; }
  .teachers { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .t-body { padding: 12px 12px 14px; }
  .t-name { font-size: 1rem; }
  .t-bio { font-size: .84rem; }
  .t-actions .btn { font-size: .8rem; padding: 10px 8px; gap: 6px; }
  .top .btn { padding: 9px 14px; font-size: .84rem; min-height: 40px; }
  .card-list { columns: 1; }
  .garden { height: 440px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .chips { flex-basis: 100%; }
  .send-form { padding: 26px 18px 18px; }
  .stage-top { left: 16px; right: 96px; top: 16px; }
  .stage .js-exit { top: 18px; right: 16px; }
  .stage-top span { display: none; }
  .flower-pick { gap: 6px; }
  .flower-pick span { width: 50px; height: 50px; border-radius: 14px; }
  .flower-pick canvas { width: 38px; height: 38px; }
  .stage-top img { height: 40px; }
  .stage-top b { font-size: 1.3rem; }
  .slide { inset: 90px 18px 150px; }
}
@media (max-width: 350px) { .event-name { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
