/* ==========================================================================
   AICST — Advance Institute of Computer Software Technology
   Design system for the ASP.NET Core rebuild (2026)
   ========================================================================== */

:root {
  --color-primary: #0b4f9c;
  --color-primary-dark: #083a75;
  --color-primary-light: #e8f1fc;
  --color-accent: #f5a623;
  --color-accent-dark: #d68c0f;
  --color-ink: #172033;
  --color-body: #45526b;
  --color-muted: #6b7794;
  --color-border: #e2e7f1;
  --color-surface: #ffffff;
  --color-surface-alt: #f6f8fc;
  --color-success: #1a8f5e;
  --color-danger: #d13b3b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Book Antiqua", "Times New Roman", serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(16, 30, 60, .08);
  --shadow-md: 0 8px 24px rgba(16, 30, 60, .10);
  --shadow-lg: 0 20px 48px rgba(16, 30, 60, .16);
  --header-h: 76px;
  --topbar-h: 40px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; font-size: 14px; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--color-body);
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-surface-alt) 32vh, var(--color-surface) 70vh);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4 { color: var(--color-ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 800; }
h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.25em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: 56px 0; }
.section--alt { background: var(--color-surface-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head .eyebrow {
  display: inline-block; color: var(--color-accent-dark); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; margin-bottom: 8px;
}
.section-head p { color: var(--color-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.6em; border-radius: 999px; font-weight: 700; font-size: .98rem;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--color-accent); color: #221400; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-accent-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-secondary { background: var(--color-primary); color: #fff; }
.btn-secondary:hover { background: var(--color-primary-dark); }
.btn-block { width: 100%; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: .5em 1.1em; font-size: .85rem; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--color-primary-dark); color: #dce8fb; font-size: .84rem;
  min-height: var(--topbar-h);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-block: 6px; }
.topbar a { color: #dce8fb; }
.topbar .topbar-links { display: flex; align-items: center; gap: 14px; }
.topbar .social { display: flex; gap: 12px; }
.topbar .social a { color: #dce8fb; font-size: 1rem; opacity: .9; }
.topbar .social a:hover { opacity: 1; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}
.site-header .container { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand img { height: 48px; width: 48px; object-fit: contain; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-name { font-weight: 800; color: var(--color-primary); font-size: 1.25rem; letter-spacing: .02em; }
.brand .brand-tagline { font-size: .72rem; color: var(--color-muted); font-weight: 600; }
.header-badge { height: 40px; display: none; flex-shrink: 0; }
@media (min-width: 860px) { .header-badge { display: block; } }

.main-nav { flex-shrink: 0; }
.main-nav ul { list-style: none; display: flex; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 0; }
.main-nav a {
  color: var(--color-ink); font-weight: 600; font-size: .92rem; padding: .6em .75em;
  border-radius: 999px; display: inline-block; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { background: var(--color-primary-light); color: var(--color-primary); text-decoration: none; }

.nav-toggle {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  margin-left: auto; background: #fff; border: 1px solid var(--color-border);
  border-radius: 10px; width: 42px; height: 40px; padding: 0; cursor: pointer; flex-shrink: 0;
  position: relative; z-index: 2;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--color-ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 1240px) { .nav-toggle { display: none; } }

@media (max-width: 1239px) {
  .main-nav {
    position: absolute; inset: var(--header-h) 0 auto 0; background: #fff; z-index: 2;
    border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md);
    display: none; padding: 10px 20px 18px; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; flex-wrap: wrap; gap: 2px; }
  .main-nav a { display: block; white-space: normal; }

  /* Dims and blocks whatever sits below the open dropdown (sidebar, page content)
     so it doesn't visually collide with the menu — sits inside .site-header's
     own stacking context (z-index: 50), which already outranks unpositioned
     page content regardless of this element's own z-index. */
  .nav-backdrop { display: none; }
  .nav-backdrop.open {
    display: block; position: fixed; inset: 0; z-index: 1;
    background: rgba(8, 16, 36, .45);
  }
}

@media (min-width: 1240px) {
  .brand .brand-tagline { max-width: 320px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary) 60%, #124b8c);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 85% 0%, rgba(245,166,35,.35), transparent 60%),
              radial-gradient(500px 260px at 10% 100%, rgba(255,255,255,.08), transparent 60%);
}
.hero .container { position: relative; padding-block: 64px 76px; }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 52px; } }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; color: #ffd28a; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; font-size: .8rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,210,138,.35); border-radius: 999px; padding: .4em 1em;
}
.hero h1 { color: #fff; max-width: 18ch; margin-top: 18px; }
.hero p.lead { color: #dce8fb; max-width: 56ch; font-size: 1.08rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn-primary { box-shadow: 0 8px 24px rgba(245,166,35,.35); }
.hero-actions .btn-primary:hover { box-shadow: 0 10px 30px rgba(245,166,35,.5); }
.hero-actions .btn-outline:hover { box-shadow: 0 8px 24px rgba(255,255,255,.12); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 28px; max-width: 560px; }
.hero-stats .stat { border-left: 2px solid rgba(255,255,255,.25); padding-left: 14px; }
.hero-stats .stat b { display: block; font-size: 1.6rem; color: #fff; }
.hero-stats .stat span { font-size: .82rem; color: #cfe0f7; }

/* ---------- Slider (hero image carousel) ---------- */
.slider {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/10; background: #0a2f5c;
  box-shadow: 0 24px 60px rgba(5, 15, 35, .45); border: 1px solid rgba(255,255,255,.14);
}
.slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.slider .slide.active { opacity: 1; }
.slider .slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: slider-kenburns 7s ease-in-out infinite alternate; }
.slider .slide.active img { animation-play-state: running; }
.slider .slide:not(.active) img { animation-play-state: paused; }
@keyframes slider-kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1.5%); } }
.slider-glow {
  position: absolute; inset: auto 0 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(4,12,28,.65), transparent);
}
.slider-arrow {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(10,20,40,.4); color: #fff; font-size: 1.3rem;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease, background .2s ease, transform .2s ease;
}
.slider:hover .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: rgba(10,20,40,.7); transform: translateY(-50%) scale(1.08); }
.slider-arrow--prev { left: 14px; }
.slider-arrow--next { right: 14px; }
.slider-dots { position: absolute; bottom: 16px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.slider-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.55); cursor: pointer; padding: 0;
  transition: all .2s ease;
}
.slider-dots button.active { background: #fff; width: 22px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .slider .slide img { animation: none; }
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 26px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.course-card {
  cursor: pointer; text-align: center; padding: 32px 20px; border-radius: var(--radius-md);
  background: var(--color-surface-alt); border: 1px solid var(--color-border); box-shadow: var(--shadow-md); transition: all .25s ease;
}
.course-card:hover {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
  box-shadow: 0 16px 32px rgba(11,79,156,.28); transform: translateY(-6px);
}
.course-card .icon {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  border-radius: 50%; font-size: 1.6rem; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--color-primary-light), #fff);
  transition: background .25s ease;
}
.course-card:hover .icon { background: rgba(255,255,255,.16); }
.course-card h3 { margin: 0; color: inherit; }

.feature-list { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
.feature-list li {
  display: flex; align-items: center; gap: 12px; background: var(--color-surface-alt);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px 16px; font-weight: 600; color: var(--color-ink);
}
.feature-list li .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); flex: none; }

/* ---------- Director / about split ---------- */
.split { display: grid; gap: 36px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: .8fr 1.2fr; } }
.split img {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; height: 100%;
  object-fit: cover; aspect-ratio: 4/5; border: 6px solid #fff; transition: transform .3s ease;
}
.split img:hover { transform: translateY(-4px); }
.badge-approved {
  display: inline-flex; align-items: center; gap: 8px; background: var(--color-primary-light);
  color: var(--color-primary); font-weight: 700; padding: .5em 1.1em; border-radius: 999px; font-size: .85rem;
  margin-top: 10px; box-shadow: 0 4px 14px rgba(11,79,156,.15);
}

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gallery-item { border-radius: var(--radius-md); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); }
.gallery-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.06); }

/* ---------- Forms ---------- */
.form-panel { max-width: 560px; margin-inline: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.form-panel-head { background: var(--color-primary); color: #fff; padding: 20px 26px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-panel-head h3 { color: #fff; margin: 0; }
.form-panel-body { padding: 26px; }

/* min-width: 0 overrides the browser's implicit "min-width: auto" on grid/flex
   items, which otherwise refuses to shrink a column below its content's
   min-content size (e.g. a <select> sized to its longest <option>) — the same
   trap .grid-2's minmax(0, 1fr) fixes for the *track*, needed here for the *item*. */
.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-weight: 700; color: var(--color-ink); margin-bottom: 6px; font-size: .92rem; }
.field .hint { color: var(--color-muted); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .75em .9em; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  font: inherit; color: var(--color-ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-light);
}
.field-validation-error, .text-danger { color: var(--color-danger); font-size: .85rem; display: block; margin-top: 4px; }
.validation-summary-errors { color: var(--color-danger); background: #fdecec; border: 1px solid #f6c6c6; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1em; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.alert-success { background: #e8f8f0; color: var(--color-success); border: 1px solid #bfe9d3; }
.alert-danger { background: #fdecec; color: var(--color-danger); border: 1px solid #f6c6c6; }
.alert-info { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid #cfe0f7; }

/* ---------- Certificate result ---------- */
.certificate-card {
  max-width: 640px; margin-inline: auto; border: 2px dashed var(--color-accent); border-radius: var(--radius-lg);
  padding: 34px; background: var(--color-surface-alt); position: relative;
}
.certificate-card dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; margin: 18px 0 0; }
.certificate-card dt { color: var(--color-muted); font-weight: 700; }
.certificate-card dd { margin: 0; color: var(--color-ink); font-weight: 600; }
.certificate-seal { position: absolute; top: 20px; right: 20px; color: var(--color-accent-dark); font-size: 2.2rem; }

/* ---------- Tables (admin) ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 360px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data-table th, table.data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: .92rem; }
table.data-table th { background: var(--color-primary); color: #fff; font-weight: 700; white-space: nowrap; }
table.data-table th a { color: #fff; text-decoration: none; }
table.data-table th a:hover { text-decoration: underline; }
table.data-table tr:hover td { background: var(--color-primary-light); }
table.data-table td.actions { display: flex; gap: 8px; white-space: nowrap; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.pagination a { padding: .5em 1.1em; border: 1.5px solid var(--color-border); border-radius: 999px; font-weight: 700; color: var(--color-primary); }
.pagination a:hover { background: var(--color-primary-light); text-decoration: none; }
.pagination a.disabled { opacity: .4; pointer-events: none; }
.pagination-status { color: var(--color-muted); font-size: .88rem; }

/* ---------- Admin shell ---------- */
.admin-shell { display: grid; min-height: calc(100vh - var(--header-h)); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .admin-shell { grid-template-columns: 240px minmax(0, 1fr); } }
.admin-sidebar { background: var(--color-primary-dark); color: #dce8fb; padding: 22px 14px; }
/* Below 900px the sidebar folds into the header's hamburger menu instead
   (see .nav-mobile-only in _AdminLayout.cshtml) so it doesn't eat screen space. */
@media (max-width: 899px) { .admin-sidebar { display: none; } }
.nav-mobile-only { display: none; }
@media (max-width: 899px) { .nav-mobile-only { display: block; } }
.main-nav .nav-divider { border-top: 1px solid var(--color-border); margin: 8px 4px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px; color: #dce8fb; padding: .7em .9em; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem; margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.12); text-decoration: none; }
.admin-content { padding: 32px 24px; background: var(--color-surface-alt); }
.admin-content h1 { font-size: 1.7rem; }
.admin-content h3 { font-size: 1.05rem; }
.stat-card { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--color-border); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-card b { font-size: 1.9rem; color: var(--color-primary); display: block; }
.stat-card span { color: var(--color-muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: none; border-radius: var(--radius-lg); padding: 0; width: min(560px, 92vw); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(10, 20, 40, .55); backdrop-filter: blur(2px); }
dialog.modal .modal-head { background: var(--color-primary); color: #fff; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
dialog.modal .modal-head h3 { color: #fff; margin: 0; }
dialog.modal .modal-close { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; }
dialog.modal .modal-body { padding: 22px 24px; }
dialog.modal .modal-body ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
dialog.modal .modal-body li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--color-ink); }
dialog.modal.lightbox { width: min(900px, 94vw); background: transparent; }
dialog.modal.lightbox .modal-body { padding: 0; }
dialog.modal.lightbox img { width: 100%; border-radius: var(--radius-md); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-ink); color: #b9c3da; margin-top: 40px; }
.site-footer .container { padding-block: 44px 24px; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
.site-footer h4 { color: #fff; font-size: .95rem; letter-spacing: .03em; text-transform: uppercase; }
.site-footer a { color: #b9c3da; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 16px 20px; display: flex; flex-wrap: wrap;
  gap: 8px 20px; align-items: center; justify-content: space-between; font-size: .84rem;
}
.footer-bottom .credit { color: #8b98b8; }
.footer-bottom .credit a { color: #cfe0f7; font-weight: 700; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { font-size: 1.05rem; }

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--color-muted); }
.divider { height: 4px; width: 64px; background: var(--color-accent); border-radius: 4px; margin: 10px auto 0; }
.divider.left { margin-inline: 0; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-primary); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }
