/* TVM Admission v8 — friendly, mobile-first theme on top of Bootstrap 5.3 */

@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/sarabun-thai-400.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/sarabun-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/sarabun-thai-500.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/sarabun-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/sarabun-thai-600.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/sarabun-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/sarabun-thai-700.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/sarabun-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --brand: #00897b;
  --brand-600: #00796b;
  --brand-700: #00695c;
  --brand-50: #e6f4f2;
  --brand-100: #c8e8e3;
  --accent: #f59e0b;
  --accent-50: #fff7e6;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f8f7;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);

  --bs-primary: var(--brand);
  --bs-primary-rgb: 0, 137, 123;
  --bs-link-color: var(--brand-600);
  --bs-link-color-rgb: 0, 121, 107;
  --bs-link-hover-color: var(--brand-700);
  --bs-body-font-family: "Sarabun", system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-radius: 10px;
  --bs-border-radius-lg: var(--radius);
  --bs-focus-ring-color: rgba(0, 137, 123, .25);
}

html { scroll-behavior: smooth; font-size: 15px; }
body { font-size: 1rem; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--ink); line-height: 1.35; }
.text-muted { color: var(--muted) !important; }
.text-brand { color: var(--brand-700) !important; }
.bg-brand-50 { background: var(--brand-50) !important; }
:focus-visible { outline: 3px solid rgba(0, 137, 123, .45); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 2000; }
.skip-link:focus { left: 8px; }

/* Buttons */
.btn { font-weight: 600; border-radius: 10px; padding: .6rem 1.15rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1.05rem; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand-600); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-700); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #3b2500; }
.btn-accent:hover { background: #e48e00; border-color: #e48e00; color: #2a1a00; }

/* Navbar */
.site-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.site-nav .navbar-brand { gap: .2rem !important; }
.site-nav .navbar-brand img { height: 40px; width: auto; }
.site-nav .brand-text { font-weight: 700; color: var(--brand-700); line-height: 1.1; font-size: 1rem; }
.site-nav .brand-text small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.site-nav .nav-link { font-weight: 600; color: var(--ink); border-radius: 8px; padding: .5rem .8rem !important; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--brand-700); background: var(--brand-50); }

/* Hero */
.hero { background: radial-gradient(1200px 400px at 10% -10%, #d6f0eb 0%, transparent 60%), linear-gradient(180deg, #eef8f6 0%, var(--bg) 100%); padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
.hero .lead { color: #374151; }
.hero-badge { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--brand-100); color: var(--brand-700); font-weight: 600; padding: .3rem .8rem; border-radius: 999px; font-size: .9rem; }

/* Cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0 !important; font-weight: 700; }
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; margin: 2rem 0 1rem; }
.section-title .bi { color: var(--brand); }

/* Round status */
.round-card { border-left: 6px solid var(--brand); }
.round-card.general { border-left-color: var(--accent); }
.round-card .when { font-size: 1.15rem; font-weight: 700; }
.state-pill { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .85rem; border-radius: 999px; padding: .2rem .7rem; }
.state-open { background: #dcfce7; color: #166534; }
.state-upcoming { background: var(--accent-50); color: #92400e; }
.state-closed { background: #f3f4f6; color: #4b5563; }
.countdown { display: flex; gap: .5rem; flex-wrap: wrap; }
.countdown div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .35rem .7rem; min-width: 64px; text-align: center; }
.countdown b { display: block; font-size: 1.3rem; color: var(--brand-700); line-height: 1.2; }
.countdown span { font-size: .75rem; color: var(--muted); }

/* Program cards */
.program-card { height: 100%; display: flex; flex-direction: column; border-top: 4px solid var(--brand); transition: transform .15s ease, box-shadow .15s ease; }
.program-card.general { border-top-color: var(--accent); }
.program-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 24, 40, .1); }
.program-card .level { font-size: .8rem; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border-radius: 6px; padding: .1rem .5rem; }
.program-card .tagline { color: var(--muted); font-style: italic; }
.qual-list { list-style: none; padding: 0; margin: 0; }
.qual-list li { position: relative; padding: .15rem 0 .15rem 1.6rem; }
.qual-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: .2rem; color: var(--brand); }
.fee-chip { display: inline-block; background: var(--brand); color: #fff; font-weight: 600; border-radius: 999px; padding: .2rem .75rem; font-size: .9rem; }
.general .fee-chip { background: var(--accent); color: #3b2500; }

/* Steps (how to apply) */
.how-steps { counter-reset: s; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .how-steps { grid-template-columns: repeat(4, 1fr); } }
.how-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; position: relative; }
.how-step .num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: .5rem; }

/* Wizard */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.apply-section { margin-bottom: 2rem; }
.apply-section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; color: var(--brand-700); padding-bottom: .5rem; margin-bottom: 1rem; border-bottom: 2px solid var(--brand-50); scroll-margin-top: 90px; }
.apply-section-title span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 1rem; flex: none; }
.wizard-nav { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: .75rem 0; margin-top: 1.5rem; z-index: 5; }

fieldset.form-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem .4rem; margin-bottom: 1.25rem; background: #fff; }
fieldset.form-section legend { float: none; width: auto; font-size: 1.05rem; font-weight: 700; padding: 0 .5rem; margin-bottom: .25rem; color: var(--brand-700); }
.form-label { font-weight: 600; margin-bottom: .3rem; }
.form-label .req { color: #dc2626; margin-left: 2px; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .8rem; border-color: #d1d5db; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(0, 137, 123, .18); }
.form-text { color: var(--muted); }
.review-list dt { color: var(--muted); font-weight: 500; }
.review-list dd { font-weight: 600; margin-bottom: .5rem; }

/* Honeypot (hidden from humans, visible to naive bots) */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Dashboard */
.status-banner { border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; gap: 1rem; align-items: center; }
.status-banner .icon { font-size: 2rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 2.4rem; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: .85rem; color: var(--muted); }
.timeline li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline li.done::before { background: var(--brand); }
.timeline li.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }

/* Documents */
.doc-item { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: #fff; }
.doc-item.ok { border-color: #86efac; background: #f6fef9; }
.doc-item.missing { border-style: dashed; }
.dropzone { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 1rem; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; background: #fafafa; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f3f4f6; }
.progress { height: 8px; border-radius: 99px; }

/* Footer */
.site-footer { background: #0f3d38; color: #cde7e3; padding: 2rem 0 1.5rem; margin-top: 3rem; }
.site-footer a { color: #fff; }
.site-footer .small { color: #9cc9c2; }

/* Banners */
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.banner-grid img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
@media (max-width: 767px) { .banner-grid { grid-template-columns: 1fr; } }

.alert { border-radius: 12px; }
.badge-soft { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.bank-box { background: var(--accent-50); border: 1px solid #fde7b0; border-radius: 12px; padding: 1rem 1.1rem; }
.bank-box .acc { font-size: 1.35rem; font-weight: 700; letter-spacing: .05em; }

@media print { .site-nav, .site-footer, .wizard-nav, .btn { display: none !important; } }

/* Applicant tabs: icon-over-label grid on phones (all visible, big tap targets), pills on wider screens */
.my-tabs { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .4rem; }
.my-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 64px; padding: .5rem .25rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--brand-700); font-weight: 600; font-size: .78rem; line-height: 1.2; text-align: center; text-decoration: none; }
.my-tab i { font-size: 1.35rem; line-height: 1; }
.my-tab:hover { background: var(--brand-50); color: var(--brand-700); }
.my-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0, 137, 123, .3); }
@media (min-width: 576px) {
  .my-tabs { display: flex; gap: .4rem; }
  .my-tab { flex-direction: row; gap: .45rem; min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
  .my-tab i { font-size: 1.05rem; }
}

/* Hero buttons stay on one row on phones (text wraps inside the button instead of the buttons wrapping) */
.hero-actions .btn { flex: 1 1 0; min-width: 0; }
@media (max-width: 575px) {
  .hero-actions .btn-lg { padding: .6rem .5rem; font-size: .95rem; line-height: 1.3; }
}
@media (min-width: 576px) {
  .hero-actions .btn { flex: 0 0 auto; }
}

/* Program card footer: fee lines in a soft box, full-width details button */
.program-card .card-footer { border-top: 0; padding: 0 1rem 1rem; }
.program-card .fee-box { background: var(--brand-50); border-radius: 12px; padding: .6rem .8rem; display: grid; gap: .3rem; }
.program-card .fee-box li { display: flex; gap: .5rem; align-items: flex-start; color: var(--brand-700); font-weight: 600; font-size: .92rem; line-height: 1.4; }
.program-card .fee-box i { margin-top: .15rem; }
.program-card.general .fee-box { background: var(--accent-50); }
.program-card.general .fee-box li { color: #7a4b00; }

/* Hero: four equal-size action buttons in a 2 x 2 grid */
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; max-width: 520px; }
.hero-grid .btn { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 56px; padding: .6rem .5rem; font-size: 1rem; line-height: 1.3; text-align: center; }
@media (max-width: 575px) { .hero-grid .btn { font-size: .92rem; min-height: 54px; } }
