:root {
  --navy: #0b2447;
  --blue: #19376d;
  --royal: #2b5fb4;
  --gold: #c8962e;
  --gold-soft: #f6e9c8;
  --maroon: #7a1f2b;
  --ink: #1d2433;
  --muted: #6b7587;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #dfe5ef;
  --ok: #1e8e5a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 36, 71, .09);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, .serif { font-family: 'Merriweather', Georgia, serif; }
a { color: var(--royal); }
.form-control, .form-select { border-color: #cfd8e6; border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
.form-control:focus, .form-select:focus { border-color: var(--royal); box-shadow: 0 0 0 .22rem rgba(43, 95, 180, .15); }
.invalid-feedback.d-block-if { display: none; }
.is-invalid ~ .invalid-feedback.d-block-if, .is-invalid + .invalid-feedback { display: block; }

/* ---------- buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; letter-spacing: .2px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-position .4s var(--ease); }
.btn-brand { color: #fff; border: 0; background: linear-gradient(120deg, var(--navy), var(--royal), var(--navy)); background-size: 200% 100%; box-shadow: 0 6px 16px rgba(11, 36, 71, .25); }
.btn-brand:hover, .btn-brand:focus { color: #fff; background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(11, 36, 71, .32); }
.btn-brand:active { transform: translateY(0); }
.btn-gold { color: #3a2600; border: 0; background: linear-gradient(120deg, #e9c46a, var(--gold)); box-shadow: 0 6px 16px rgba(200, 150, 46, .35); }
.btn-gold:hover { color: #3a2600; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(200, 150, 46, .45); }
.btn-outline-brand { color: var(--navy); border: 1.5px solid var(--navy); background: transparent; }
.btn-outline-brand:hover { color: #fff; background: var(--navy); transform: translateY(-2px); }
.btn-login { padding: .55rem 1.3rem; border-radius: 999px; }
.pulse { animation: pulse 2.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(43, 95, 180, .5); } 70% { box-shadow: 0 0 0 12px rgba(43, 95, 180, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 95, 180, 0); } }

/* ---------- header ---------- */
.topbar { background: var(--navy); color: #d7e1f3; font-size: .78rem; padding: .35rem 0; }
.topbar i { color: var(--gold); margin-right: .25rem; }
.main-nav { background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); box-shadow: 0 2px 18px rgba(11, 36, 71, .08); padding: .5rem 0; }
.brand-logo { width: 54px; height: 54px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; max-width: 560px; }
.brand-text strong { font-family: 'Merriweather', serif; font-size: .95rem; color: var(--navy); white-space: normal; }
.brand-text small { font-size: .68rem; color: var(--muted); white-space: normal; }
.main-nav .nav-link { color: var(--ink); font-weight: 500; font-size: .9rem; position: relative; }
.main-nav .nav-link::after { content: ''; position: absolute; left: .9rem; right: .9rem; bottom: .2rem; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.main-nav .nav-link:hover::after, .main-nav .nav-link.active::after { transform: scaleX(1); }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; padding: 5rem 0 6.5rem; overflow: hidden;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(200, 150, 46, .35), transparent 60%), linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, #234a8f 100%); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .07; background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 26px 26px; }
.hero .badge-pill { display: inline-block; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .35rem .9rem; font-size: .8rem; margin-bottom: 1rem; }
.hero h1 { font-weight: 900; font-size: clamp(1.7rem, 3.6vw, 2.8rem); line-height: 1.25; }
.hero h1 span { color: #f2cf79; }
.hero p.lead { color: #d7e1f3; font-size: 1.02rem; max-width: 640px; }
.hero-art { position: relative; text-align: center; }
.hero-art .seal { width: min(260px, 70%); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); animation: floaty 6s ease-in-out infinite; background: #fff; border-radius: 50%; padding: 10px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 60px; }

.stat-strip { margin-top: -3.2rem; position: relative; z-index: 5; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; display: flex; align-items: center; gap: 1rem; height: 100%; transition: transform .3s var(--ease), box-shadow .3s var(--ease); border-bottom: 3px solid var(--gold); }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(11, 36, 71, .15); }
.stat-card .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: linear-gradient(135deg, var(--navy), var(--royal)); flex: none; }
.stat-card .num { font-size: 1.55rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.stat-card .lbl { font-size: .8rem; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 4rem 0 1rem; }
.section-title { font-weight: 700; color: var(--navy); font-size: 1.55rem; position: relative; padding-bottom: .7rem; margin-bottom: 1.6rem; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold), #f2cf79); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.notice-item { display: flex; gap: .9rem; padding: .85rem 0; border-bottom: 1px dashed var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-date { flex: none; width: 56px; text-align: center; border-radius: 10px; background: var(--gold-soft); color: #6b4a00; padding: .3rem 0; line-height: 1.1; }
.notice-date b { display: block; font-size: 1.15rem; }
.notice-date small { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; }
.table-posts thead th { background: var(--navy); color: #fff; font-weight: 500; font-size: .85rem; border: 0; white-space: nowrap; }
.table-posts tbody tr { transition: background .2s; }
.table-posts tbody tr:hover { background: #eef3fc; }
.step-card { text-align: center; padding: 1.5rem 1rem; height: 100%; }
.step-card .n { width: 54px; height: 54px; margin: 0 auto .8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 1.2rem; background: linear-gradient(135deg, var(--gold), #e0b04f); box-shadow: 0 8px 18px rgba(200, 150, 46, .4); }
.doc-link { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); transition: all .25s var(--ease); }
.doc-link:hover { border-color: var(--royal); transform: translateX(4px); box-shadow: var(--shadow); }
.doc-link i { font-size: 1.5rem; color: var(--maroon); }

.site-footer { margin-top: 4rem; background: var(--navy); color: #c9d6ee; padding: 2.5rem 0 1rem; }
.site-footer h6 { color: #f2cf79; margin-bottom: .8rem; }
.site-footer a { color: #c9d6ee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .copy { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 1.5rem; padding-top: 1rem; text-align: center; font-size: .78rem; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .pulse, .hero-art .seal { animation: none; } html { scroll-behavior: auto; } }

/* ---------- login / register modal ---------- */
.auth-modal.fade .modal-dialog { transform: translateY(24px) scale(.95); opacity: 0; transition: transform .55s var(--ease), opacity .55s var(--ease); }
.auth-modal.show .modal-dialog { transform: none; opacity: 1; }
.auth-modal.fade { transition: opacity .5s ease; }
.modal-backdrop.show { opacity: .62; backdrop-filter: blur(3px); }
.auth-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.auth-head { position: relative; text-align: center; color: #fff; padding: 1.6rem 1.5rem 1.3rem; background: linear-gradient(135deg, var(--navy), var(--royal)); }
.auth-head .btn-close { position: absolute; right: 1rem; top: 1rem; }
.auth-head h5 { font-family: 'Merriweather', serif; margin: .6rem 0 .2rem; }
.auth-head p { margin: 0; font-size: .78rem; color: #cfdcf3; }
.auth-logo { width: 64px; height: 64px; background: #fff; border-radius: 50%; padding: 4px; object-fit: contain; }
.auth-tabs { background: #eef2f9; border-radius: 12px; padding: 5px; }
.auth-tabs .nav-link { color: var(--navy); border-radius: 9px; font-weight: 500; transition: all .25s; }
.auth-tabs .nav-link.active { background: linear-gradient(120deg, var(--navy), var(--royal)); color: #fff; box-shadow: 0 6px 14px rgba(11, 36, 71, .25); }

/* ---------- dashboard / generic pages ---------- */
.page-head { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; padding: 2rem 0 3.2rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-body { margin-top: -2rem; }
.progress-steps { display: flex; flex-wrap: wrap; gap: .5rem; }
.progress-steps .chip { padding: .3rem .8rem; border-radius: 999px; font-size: .78rem; background: #eef2f9; color: var(--muted); }
.progress-steps .chip.done { background: #dcf3e8; color: var(--ok); }
.instr-list li { margin-bottom: .75rem; padding-left: .3rem; }
.instr-list li::marker { color: var(--gold); font-weight: 600; }

/* ---------- application wizard ---------- */
.wizard-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem .1rem .8rem; scrollbar-width: thin; }
.wizard-tabs .wtab { flex: none; border: 1px solid #d6cdf5; background: #fff; color: #5b21b6; border-radius: 8px; padding: .5rem .85rem; font-size: .72rem; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; cursor: pointer; transition: all .25s var(--ease); display: inline-flex; align-items: center; gap: .4rem; }
.wizard-tabs .wtab { color: var(--navy); border-color: #cdd7ea; }
.wizard-tabs .wtab:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(11, 36, 71, .12); }
.wizard-tabs .wtab.active { background: linear-gradient(120deg, var(--navy), var(--royal)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(11, 36, 71, .28); }
.wizard-tabs .wtab.done::after { content: '\F26A'; font-family: 'bootstrap-icons'; color: var(--ok); font-size: .9rem; }
.wizard-tabs .wtab.active.done::after { color: #9ff0c4; }
.wizard-tabs .wtab:disabled { opacity: .5; cursor: not-allowed; }
.step-pane { display: none; }
.step-pane.active { display: block; animation: stepIn .45s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
.step-pane.back.active { animation-name: stepInBack; }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.step-title { font-weight: 700; color: var(--navy); font-size: 1.25rem; margin-bottom: .3rem; }
.step-sub { color: var(--muted); font-size: .9rem; }
.note-red { color: #c62828; font-size: .74rem; font-style: italic; }
.req::after { content: ' *'; color: #c62828; }
.photo-box { width: 130px; text-align: center; }
.photo-box .frame { width: 130px; height: 150px; border-radius: 12px; border: 2px dashed #b9c5dc; background: #f1f4fa; display: grid; place-items: center; overflow: hidden; color: #9aa7bf; font-size: 2.6rem; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.table-entry { --bs-table-bg: #fff; font-size: .88rem; }
.table-entry thead th { background: #eaf0f8; font-weight: 600; font-size: .78rem; vertical-align: middle; white-space: nowrap; }
.table-entry td { vertical-align: top; padding: .55rem .5rem; }
.table-entry .form-control, .table-entry .form-select { font-size: .85rem; min-width: 120px; }
.table-entry .w-sm { min-width: 80px; }
.table-entry .w-md { min-width: 118px; }
.table-entry .w-lg { min-width: 150px; }
.table-entry tbody tr { transition: background .2s; animation: rowIn .4s var(--ease); }
.table-entry tbody tr.removing { opacity: 0; transform: translateX(30px); transition: all .3s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.rm-btn { color: #c62828; border: 0; background: transparent; font-size: 1.15rem; padding: .2rem .4rem; border-radius: 6px; transition: background .2s, transform .2s; }
.rm-btn:hover { background: #fde8e8; transform: scale(1.1); }
.existing-file { font-size: .75rem; display: block; margin-top: .25rem; }
.group-box { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1.3rem; background: #fcfdff; transition: box-shadow .3s; }
.group-box:hover { box-shadow: 0 6px 18px rgba(11, 36, 71, .06); }
.group-box h6 { font-weight: 600; color: var(--navy); }
.skip-check { background: #f2f6fc; border-radius: 10px; padding: .5rem .8rem .5rem 2.3rem; }
.group-body { transition: opacity .3s; }
.group-body.hidden { display: none; }
.warn-line { font-size: .78rem; color: #8a5a00; background: #fff6e0; border-radius: 8px; padding: .35rem .6rem; margin-top: .4rem; display: none; }
.warn-line.show { display: block; }
.total-line { font-weight: 600; color: var(--navy); }
.pay-box { background: #f4f8ff; border: 1px solid #d5e2f7; border-radius: 14px; padding: 1.2rem; }
.pay-table th { width: 38%; font-weight: 600; background: transparent; }
.pay-table tr:nth-child(odd) { background: #e9f0fb; }
.qr-img { max-width: 190px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.decl-box { background: #fff6e0; border: 1px solid #f0d9a0; border-radius: 12px; padding: 1rem 1rem 1rem 2.6rem; }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.btn-ghost { color: var(--royal); background: transparent; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; font-size: .82rem; border: 0; }
.btn-ghost:hover { color: var(--navy); background: #eaf0fb; }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.toast-msg { background: var(--navy); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); animation: toastIn .35s var(--ease); max-width: 340px; font-size: .88rem; }
.toast-msg.err { background: #b3261e; } .toast-msg.ok { background: #1e7a50; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.field-error { color: #b3261e; font-size: .78rem; margin-top: .2rem; }
.group-error { color: #b3261e; font-size: .85rem; margin-bottom: .5rem; font-weight: 500; }

/* ---------- acknowledgment (screen + print) ---------- */
.ack-sheet { background: #fff; max-width: 900px; margin: 0 auto 2rem; padding: 2rem 2.2rem; border-radius: 6px; box-shadow: var(--shadow); font-size: .9rem; }
.ack-head { text-align: center; border-bottom: 3px double var(--navy); padding-bottom: .8rem; margin-bottom: 1rem; }
.ack-head img { width: 70px; height: 70px; object-fit: contain; }
.ack-head h2 { font-size: 1.15rem; margin: .4rem 0 .1rem; color: var(--navy); }
.ack-title { text-align: center; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin: .8rem 0; padding: .35rem; background: #eaf0f8; }
.ack-no { font-size: 1.3rem; font-weight: 700; color: var(--maroon); letter-spacing: 1px; }
.ack-sheet table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.ack-sheet th, .ack-sheet td { border: 1px solid #b9c3d6; padding: .35rem .5rem; vertical-align: top; }
.ack-sheet th { background: #f2f5fb; width: 28%; text-align: left; font-weight: 600; }
.ack-sheet table.grid th { width: auto; background: #eaf0f8; }
.ack-sheet h3 { font-size: .95rem; background: var(--navy); color: #fff; padding: .3rem .6rem; margin: 1rem 0 .4rem; font-family: 'Poppins', sans-serif; }
.ack-photo { width: 110px; height: 130px; object-fit: cover; border: 1px solid #999; }
@media print {
  .print-only { display: block !important; }
  body { background: #fff; }
  .no-print, .topbar, .main-nav, .site-footer, .toast-wrap, .modal, .modal-backdrop { display: none !important; }
  .ack-sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .page-break { page-break-before: always; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4; margin: 12mm; }
}

@media (max-width: 575px) {
  .brand-logo { width: 42px; height: 42px; }
  .brand-text strong { font-size: .8rem; } .brand-text small { display: none; }
  .hero { padding: 3rem 0 5rem; }
  .ack-sheet { padding: 1rem; }
}

/* ---------- category chooser (Step 1), file remove, vacant-for badges ---------- */
.cat-panel { border: 1px dashed #b9c5dc; border-radius: 12px; background: #f7f9fd; padding: 1rem 1.1rem; min-height: 100%; transition: border-color .25s, background .25s; }
.cat-panel:has(input:checked) { border-color: var(--royal); background: #f1f6ff; }
.cat-opt { padding: .45rem .75rem .45rem 2.2rem; margin-bottom: .4rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: all .2s var(--ease); animation: rowIn .35s var(--ease); }
.cat-opt:hover { border-color: var(--royal); transform: translateX(3px); }
.cat-opt:has(input:checked) { border-color: var(--royal); background: #eaf1ff; font-weight: 600; }
.file-cell .input-group .form-control { min-width: 0; }
.file-cell .btn-outline-danger { padding-inline: .6rem; }
.vac-badge { display: inline-block; margin: .1rem .15rem .1rem 0; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #e7efff; color: var(--navy); border: 1px solid #cdd9f3; white-space: nowrap; }

/* ---------- checkboxes, radio buttons and switches: always clearly visible (whole site) ---------- */
.form-check-input { border: 2px solid #2f4468; background-color: #fff; }
.form-check-input:hover { border-color: var(--royal); }
.form-check-input:focus { border-color: var(--royal); box-shadow: 0 0 0 .22rem rgba(43, 95, 180, .22); }
.form-check-input:checked { background-color: var(--royal); border-color: var(--navy); }
.form-switch .form-check-input:not(:checked) { background-color: #fff; }

.print-only { display: none; }
