/* Ban Khuyến học Giáo xứ Xuân Dục — khuyenhocxuanduc.top */
:root {
  --bg: #FBF8F2;
  --surface: #FFFFFF;
  --ink: #2C2420;
  --muted: #6B5E54;
  --faint: #A99C8D;
  --line: #EFE7DA;
  --line-strong: #D8CCBB;
  --red: #922F26;
  --red-dark: #7A2620;
  --red-tint: #FBF3F2;
  --red-line: #E5C8C4;
  --gold: #B98A2F;
  --gold-ink: #8A6516;
  --gold-deep: #5C4A1E;
  --gold-tint: #F6EDDA;
  --gold-line: #E3CFA0;
  --row-line: #F3EDE2;
  --head-tint: #F6F0E4;
  --dark: #2C2420;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Lora', Georgia, serif; margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
img { max-width: 100%; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ============ Header / nav ============ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-badge { width: 42px; height: 42px; border-radius: 10px; background: var(--red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 13px; color: var(--muted); line-height: 1.2; }
.nav-links { display: none; align-items: center; gap: 28px; }
.nav-links a { font-size: 16px; color: var(--ink); }
.nav-links a.active { color: var(--red); font-weight: 700; }
.nav-cta { display: none; align-items: center; gap: 8px; min-height: 46px; background: var(--red); color: #fff !important; border-radius: 12px; padding: 0 20px; font-weight: 700; font-size: 15px; }
.nav-cta:hover { background: var(--red-dark); }
.mobile-tabs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 8px 12px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.mobile-tabs a {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 36px; padding: 4px 6px; border: 0; border-radius: 10px;
  font-size: 13.5px; font-weight: 700; line-height: 1.25; color: #fff;
  background: linear-gradient(180deg, #B04437, var(--red));
  box-shadow: 0 3px 0 #6E1F18, 0 4px 8px rgba(0, 0, 0, 0.18);
}
.mobile-tabs a:active { transform: translateY(2px); box-shadow: 0 1px 0 #6E1F18, 0 2px 4px rgba(0, 0, 0, 0.15); }
.mobile-tabs a.active {
  color: #3A2A08;
  background: linear-gradient(180deg, #E7BC55, #C9952F);
  box-shadow: 0 3px 0 #8A6516, 0 4px 8px rgba(0, 0, 0, 0.18);
}

/* ============ Components ============ */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 13px; min-height: 54px; padding: 0 22px; font-size: 18px; font-weight: 700; text-align: center; }
.btn-primary { background: var(--red); color: #fff !important; box-shadow: 0 4px 14px rgba(146,47,38,.28); }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink) !important; font-weight: 600; font-size: 16px; min-height: 50px; }
.btn-outline:hover { border-color: var(--faint); }
.btn-gold { background: var(--gold); color: #fff !important; }
.btn-dashed { background: var(--surface); border: 2px dashed var(--red); color: var(--red) !important; }
.btn-block { width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line-strong); font-size: 16px; color: var(--ink); cursor: pointer; user-select: none; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.chip-gold.active { background: var(--gold); border-color: var(--gold); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; background: var(--gold-tint); color: var(--gold-ink); font-size: 14px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.notice-strip { background: var(--red-tint); border: 1px solid var(--red-line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.55; }
.notice-strip strong { color: var(--red); }
.notice-strip svg { flex-shrink: 0; margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 16px; font-weight: 600; }
.field input[type="text"], .field input[type="tel"] {
  min-height: 52px; background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 12px; padding: 0 14px; font-size: 18px; color: var(--ink); width: 100%;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.field .hint { font-size: 15px; color: var(--muted); }
.field.error input { border-color: var(--red); }
.field .err-msg { display: none; font-size: 15px; color: var(--red); font-weight: 600; }
.field.error .err-msg { display: block; }
.help-line { font-size: 15px; color: var(--muted); line-height: 1.5; text-align: center; }

/* checkbox-like tick rows */
.tick-row { display: flex; align-items: center; gap: 12px; min-height: 50px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; cursor: pointer; user-select: none; font-size: 17px; }
.tick-row .box { width: 26px; height: 26px; border: 2px solid #B0A392; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: transparent; }
.tick-row.checked { background: var(--red-tint); border-color: var(--red); font-weight: 600; }
.tick-row.checked .box { background: var(--red); border-color: var(--red); }
.tick-row.checked .box::after { content: ''; width: 13px; height: 8px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px,-2px); }

.footer { background: var(--dark); color: #C9BCA9; margin-top: 40px; }
.footer .container { padding: 26px 16px; display: grid; gap: 18px; }
.footer strong { color: var(--gold-tint); }
.footer p { font-size: 15px; line-height: 1.6; }
.footer a { color: var(--gold-tint); }

.section { padding: 24px 0; }
.section-title { font-size: 22px; margin-bottom: 12px; }
.money { font-variant-numeric: tabular-nums; }

/* ============ Trang chủ ============ */
.hero { background: linear-gradient(180deg, #FFFFFF 0%, #FBF8F2 100%); padding: 26px 0 22px; }
.hero-grid { display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: 30px; }
.hero .lead { font-size: 18px; color: var(--muted); line-height: 1.55; }
.hero .lead strong { color: var(--red); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.badge-gold { background: var(--gold-tint); border: 1px solid var(--gold-line); color: var(--gold-ink); }
.badge-red { background: var(--red); color: #fff; }
.share-note { background: var(--gold-tint); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 16px; color: var(--gold-deep); }
.share-note svg { flex-shrink: 0; margin-top: 2px; }
.dien-card { padding: 18px 16px; }
.dien-card h2 { font-size: 21px; margin-bottom: 6px; }
.dien-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--row-line); font-size: 16px; }
.dien-row:last-child { border-bottom: 0; }
.dien-row svg { flex-shrink: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.stat-box { background: var(--surface); border: 1px solid var(--gold-line); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat-box .num { font-size: 20px; font-weight: 700; color: var(--gold-ink); }
.stat-box .lbl { font-size: 13px; color: var(--muted); }
.gold-card { background: linear-gradient(180deg, #F6EDDA 0%, #FFFDF8 100%); border: 1px solid var(--gold-line); border-radius: 16px; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.gold-card h2 { font-size: 21px; color: var(--gold-deep); display: flex; align-items: center; gap: 10px; }
.white-card { padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.mini-stats { display: flex; flex-direction: column; gap: 10px; }
.mini-stats .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; color: var(--muted); }
.mini-stats .row b { font-size: 20px; color: var(--red); }
.home-cards { display: grid; gap: 16px; }

/* ============ Form nộp giấy khen ============ */
.wizard { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
.progress { display: flex; gap: 6px; margin: 16px 0 6px; }
.progress span { flex: 1; height: 6px; border-radius: 999px; background: #E8DFD0; }
.progress span.done { background: var(--red); }
.step-label { font-size: 15px; font-weight: 600; color: var(--red); margin-bottom: 14px; }
.wizard .step { display: none; flex-direction: column; gap: 18px; }
.wizard .step.active { display: flex; }
.child-panel { border: 1.5px solid #CBB98F; border-radius: 14px; background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.award-panel { background: #FFFDF8; border-top: 1px dashed var(--gold-line); margin: 0 -12px -8px; padding: 12px; display: none; flex-direction: column; gap: 12px; border-radius: 0 0 10px 10px; }
.award-panel.open { display: flex; }
.award-panel label { font-size: 15px; font-weight: 600; color: var(--gold-deep); }
.award-entry { border: 1px solid var(--gold-line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.award-entry .remove-award { align-self: flex-end; background: none; border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest-row .pill { cursor: pointer; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { width: 82px; height: 108px; border-radius: 8px; background: var(--gold-tint); border: 1px solid var(--gold-line); position: relative; overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .del { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 999px; background: rgba(44,36,32,.75); color: #fff; border: 0; font-size: 15px; line-height: 1; }
.photo-add { min-width: 110px; min-height: 108px; border: 2px dashed #CBB98F; background: #FFFDF8; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--red); font-weight: 600; font-size: 15px; cursor: pointer; text-align: center; }
.review-card { border: 1.5px solid #CBB98F; border-radius: 14px; background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.review-card .head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.review-card .who { font-size: 18px; font-weight: 700; }
.review-card .tag-sm { font-size: 15px; font-weight: 700; color: var(--gold-ink); }
.review-card .edit-btn { min-height: 42px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: 16px; }
.review-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.review-photos { display: flex; align-items: center; gap: 8px; }
.review-photos .photo-thumb { width: 56px; height: 74px; }
.consent-line { font-size: 15px; color: var(--muted); line-height: 1.55; text-align: center; }
.form-msg { display: none; border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.5; }
.form-msg.err { display: block; background: var(--red-tint); border: 1px solid var(--red-line); color: var(--red-dark); }
.form-msg.ok { display: block; background: var(--gold-tint); border: 1px solid var(--gold-line); color: var(--gold-deep); }
.success-view { max-width: 560px; margin: 0 auto; padding: 24px 16px 40px; display: none; flex-direction: column; gap: 14px; text-align: left; }
.success-view.active { display: flex; }
.success-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 16px 0; }
.success-badge { width: 76px; height: 76px; border-radius: 999px; background: var(--red); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(146,47,38,.3); }
.invite-card { background: var(--gold-tint); border: 1px solid var(--gold-line); border-radius: 14px; padding: 16px; color: var(--gold-deep); font-size: 16px; line-height: 1.6; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Bảng vàng ============ */
.gold-hero { background: linear-gradient(180deg, #F6EDDA 0%, #FBF8F2 100%); padding: 28px 0 18px; text-align: center; }
.gold-hero h1 { font-size: 28px; color: var(--gold-deep); }
.gold-hero .sub { font-size: 17px; color: var(--muted); margin-top: 6px; }
.student-list { display: grid; gap: 10px; }
.student-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--gold-line); border-radius: 12px; padding: 12px 14px; }
.student-card svg { flex-shrink: 0; }
.student-card .info { flex: 1; min-width: 0; }
.student-card .name { font-size: 17px; font-weight: 700; }
.student-card .parent { font-size: 14px; color: var(--gold-ink); }
.student-card .school { font-size: 14px; color: var(--muted); }
.student-card .pill { flex-shrink: 0; max-width: 46%; text-align: right; white-space: normal; line-height: 1.3; font-size: 13px; }
.privacy-note { font-size: 15px; color: var(--muted); line-height: 1.55; }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 48px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 0 14px; }
.search-box input { border: 0; outline: 0; flex: 1; font-size: 16px; background: transparent; min-width: 0; color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }

/* ============ Đóng góp / Báo cáo ============ */
.qr-card { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.qr-flex { display: flex; gap: 14px; align-items: center; }
.qr-box { width: 128px; height: 128px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.bank-lines { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bank-lines .lbl { font-size: 14px; color: var(--muted); }
.bank-lines .val { font-size: 18px; font-weight: 700; word-break: break-word; }
.ck-note { background: var(--gold-tint); border-radius: 10px; padding: 12px 14px; font-size: 15px; line-height: 1.55; color: var(--gold-deep); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; width: 14px; flex-shrink: 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--gold); margin-top: 5px; }
.tl-dot.now { background: var(--red); }
.tl-line { width: 2px; flex: 1; background: var(--gold-line); }
.tl-body { padding-bottom: 14px; }
.tl-year { font-size: 16px; font-weight: 700; color: var(--gold-ink); }
.tl-year.now { color: var(--red); }
.tl-body p { font-size: 15px; color: var(--muted); line-height: 1.55; }
.ledger { overflow: hidden; }
.ledger-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--head-tint); font-weight: 700; font-size: 16px; }
.ledger-head .sum { color: var(--gold-ink); font-size: 15px; }
.ledger-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--row-line); font-size: 15px; }
.ledger-row b { font-weight: 600; white-space: nowrap; }
.ledger-row.major { background: var(--red-tint); font-weight: 700; }
.ledger-row.major b { color: var(--red); }
.balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.balance-grid .cell .lbl { font-size: 14px; color: var(--muted); }
.balance-grid .cell .val { font-size: 18px; font-weight: 700; }
.balance-grid .cell .val.red { color: var(--red); }
.balance-grid .cell .val.gold { color: var(--gold-ink); }
.trust-note { display: flex; gap: 10px; align-items: flex-start; padding: 14px; font-size: 15px; color: var(--muted); line-height: 1.55; }
.trust-note svg { flex-shrink: 0; margin-top: 2px; }
.year-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.year-table th, .year-table td { padding: 11px 14px; text-align: right; border-top: 1px solid var(--row-line); }
.year-table th:first-child, .year-table td:first-child { text-align: left; }
.year-table thead th { background: var(--head-tint); border-top: 0; font-size: 15px; }
.year-table tr.hl { background: var(--red-tint); font-weight: 700; }
.show-more { width: 100%; }
.hidden { display: none !important; }

/* ============ Desktop ============ */
@media (min-width: 1000px) {
  body { font-size: 17px; }
  .site-header .container { min-height: 76px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 14px; }
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .mobile-tabs { display: none; }
  .hero { padding: 52px 0 40px; }
  .hero-grid { display: grid; grid-template-columns: 1fr 460px; gap: 56px; align-items: start; }
  .hero h1 { font-size: 46px; }
  .hero .lead { font-size: 20px; }
  .home-cards { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer .container { grid-template-columns: repeat(3, 1fr); }
  .gold-hero h1 { font-size: 38px; }
  .student-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .hero-two { display: grid; grid-template-columns: 1fr 440px; gap: 48px; align-items: start; }
  .balance-grid { grid-template-columns: repeat(4, 1fr); }
  .section { padding: 32px 0; }
}

/* Popup nhỏ báo điền thiếu (form nộp giấy khen) */
.form-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px); padding: 12px 18px;
  background: var(--red); color: #fff; border-radius: 12px;
  font-size: 15px; line-height: 1.45; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 1000;
}
.form-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Popup báo hồ sơ trùng (form nộp giấy khen) */
.dup-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dup-box { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 22px 20px; max-width: 440px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.dup-box h3 { margin: 0 0 10px; color: var(--red); font-size: 20px; }
.dup-box p { margin: 0 0 10px; line-height: 1.5; font-size: 16px; }
.dup-box .dup-hint { color: var(--faint); font-size: 14px; }
.dup-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
