:root {
  --blue: #0057a4;
  --blue-dark: #003a70;
  --yellow: #ffd447;
  --yellow-soft: #fff7cc;
  --red: #c1121f;
  --bg: #fefce8;
  --text: #111827;
  --text-muted: #4b5563;
  --card-bg: #ffffff;
  --border: #e5e7eb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fff9c4 0, var(--bg) 45%, #ffffff 100%);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--blue-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to right, var(--blue-dark), var(--blue));
  color: #f9fafb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 52px;
  width: auto;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  background: #ffffff;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #e5e7eb;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.nav-links a {
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: #e5e7eb;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.08s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-register {
  margin-left: 0.25rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: #e5e7eb;
}

.lang-btn {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.lang-btn.active,
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #111827;
}

.lang-divider {
  opacity: 0.6;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: #f9fafb;
  border-radius: 999px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(to right, var(--yellow), #ffe27a);
  color: #1f2937;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.6);
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.9);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: #ffffff;
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn-outline:hover {
  background: var(--yellow-soft);
  border-color: var(--yellow);
}

.page-main {
  padding-bottom: 3rem;
}

.hero {
  padding: 2.5rem 0 2rem;
  background: linear-gradient(135deg, rgba(0, 87, 164, 0.12), rgba(255, 212, 71, 0.25));
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  margin: 0 0 0.75rem;
  color: var(--blue-dark);
}

.hero-text p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-panel {
  background: #ffffff;
  border-radius: 1rem;
  border: 2px solid var(--blue);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.hero-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--blue-dark);
}

.hero-panel p {
  margin-bottom: 0.5rem;
  font-size: 0.94rem;
}

.section {
  padding: 2.25rem 0;
}

.section-alt {
  background: rgba(255, 247, 209, 0.8);
}

.section-small {
  padding-top: 1rem;
}

h1,
h2,
h3 {
  color: var(--blue-dark);
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
}
h3 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.35rem;
}

p {
  margin: 0 0 0.9rem;
  font-size: 0.96rem;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: flex-start;
}

.card {
  background: var(--card-bg);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.35);
}

.card-title {
  margin-top: 0;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--red);
  color: #fef2f2;
  margin-bottom: 0.5rem;
}

.news-grid,
.library-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr);
  gap: 1.4rem;
}

/* =========================
   Events (News) cards
   ========================= */
.events-section {
  margin-top: 1.25rem;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.event-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.event-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.event-body {
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.event-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.event-title {
  font-size: 1.02rem;
  margin: 0;
  line-height: 1.25;
}

.event-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.event-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(0, 87, 164, 0.12);
  color: var(--blue-dark);
}

/* =========================
   Library (CSV-driven) table
   ========================= */
.library-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0 0.5rem;
}

.library-search {
  width: min(520px, 100%);
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.95rem;
}

.video-table-wrap {
  overflow-x: auto;
}

.video-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
  font-size: 0.98rem;
}

.video-table th,
.video-table td {
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  vertical-align: top;
}

.video-table th {
  background: rgba(0, 0, 0, 0.04);
  text-align: left;
  font-weight: 700;
}

.video-table .group-row td {
  font-weight: 800;
  background: rgba(0, 0, 0, 0.06);
}

.video-table .placeholder {
  color: rgba(0, 0, 0, 0.6);
  font-style: italic;
  white-space: nowrap;
}

.small-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Responsive video embeds */
.video-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #0b1220;
}

.video-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.media-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.video-placeholder,
.image-placeholder {
  border-radius: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.9);
  padding: 0.6rem 0.75rem;
  background: #f9fafb;
}

.howto-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.curriculum-level {
  margin-bottom: 1.4rem;
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(0, 87, 164, 0.35);
  background: #ffffff;
}

.curriculum-level h2 {
  margin-top: 0;
}

.curriculum-level ul {
  margin: 0.35rem 0 0.35rem 1.2rem;
  padding: 0;
  font-size: 0.9rem;
}

.tenets-list {
  margin: 0.6rem 0 0;
  padding-left: 1.35rem;
  font-size: 0.9rem;
}

.belt-meaning {
  margin: 0.6rem 0 0.6rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.philo-section {
  margin-bottom: 1.75rem;
}

.contact-details p {
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
}

.form {
  width: 100%;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
}

.form-row label {
  font-size: 0.86rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  background: #ffffff;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(0, 87, 164, 0.4);
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-bottom: 0.5rem;
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox input {
  margin-top: 0.15rem;
}

.consent-block {
  margin-bottom: 0.6rem;
}

.form-logo-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.form-logo {
  height: 60px;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  background: #ffffff;
}

.form-logo-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.pill {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 87, 164, 0.35);
  color: var(--blue-dark);
  background: #ffffff;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fef9c3;
  padding: 1rem 0 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}

.footer-info a {
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .main-nav {
    position: absolute;
    inset: 100% 0 auto;
    padding: 0.6rem 1.25rem 0.9rem;
    background: linear-gradient(to bottom, var(--blue-dark), var(--blue));
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.16s ease, opacity 0.16s ease;
  }
  .main-nav.nav-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .nav-register {
    margin-left: 0;
  }
  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 1.7rem;
  }
  .header-inner {
    padding-inline: 0.25rem;
  }
}

/* === Curriculum table + belt icons === */

.belt-icon {
  max-width: 70px;
  height: auto;
  display: block;
  margin: 0.5rem auto;
}

.curriculum-table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
}

.curriculum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #ffffff;
}

.curriculum-table th,
.curriculum-table td {
  border: 1px solid #333;
  padding: 0.75rem;
  vertical-align: top;
  text-align: left;
}

.curriculum-table thead th {
  text-align: center;
  font-weight: 700;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.9rem;
}

.curriculum-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.curriculum-table tbody td:first-child {
  text-align: center;
  font-size: 0.8rem;
}

.curriculum-table tbody td:first-child strong {
  display: block;
  font-size: 0.85rem;
  color: var(--blue-dark);
  margin-bottom: 0.25rem;
}

.curriculum-notes {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--yellow-soft);
  border-radius: 0.75rem;
  border: 1px solid var(--yellow);
}

.curriculum-notes h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.curriculum-notes ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.curriculum-notes li {
  margin-bottom: 0.5rem;
}

/* Responsive table for smaller screens */
@media (max-width: 860px) {
  .curriculum-table {
    font-size: 0.75rem;
  }

  .curriculum-table th,
  .curriculum-table td {
    padding: 0.5rem;
  }

  .belt-icon {
    max-width: 50px;
  }
}

/* ===== LANGUAGE-SPECIFIC CONTENT ===== */
.lang-en {
  display: block;
}

.lang-vi {
  display: none;
}

/* IMPORTANT: script.js handles visibility of .lang-en and .lang-vi blocks
   Do NOT add display: none rules here - they will break the language switcher! */

.curriculum-body {
  margin-top: 1.5rem;
}

.philo-figure {
  margin: 1rem 0;
  text-align: center;
}

.philo-figure img {
  max-width: 100px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.philo-figure figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Curriculum header with emblem and flag */
.curriculum-header-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.curriculum-header-icons img {
  width: 100px;
  height: auto;
}


/* Registration form enhancements */
.form-section{margin:1.5rem 0;}
.grid-2{display:grid;grid-template-columns:1fr;gap:1rem;}
@media (min-width: 768px){.grid-2{grid-template-columns:1fr 1fr;}}
.initial-list{display:flex;flex-direction:column;gap:.75rem;}
.initial-row{display:flex;align-items:flex-start;gap:.75rem;}
.initial-input{width:4.5rem;min-width:4.5rem;height:2.5rem;padding:.5rem;border:1px solid #ccc;border-radius:.5rem;font-weight:700;text-transform:uppercase;}
.initial-text{flex:1;line-height:1.4;}
.radio-inline{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:center;margin:.5rem 0 1rem;}
.radio-inline .radio{display:flex;align-items:center;gap:.5rem;}


/* ===== Registration form fixes ===== */
.form-control {
  width: 100%;
  max-width: 520px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cfd8e3;
  border-radius: 0.5rem;
  font-size: 1rem;
}
.form-label { display:block; margin-top: 0.75rem; margin-bottom: 0.25rem; }

/* Initials rows */
.initial-row{
  display:flex;
  align-items:center;
  gap:1rem;
  margin: 0.75rem 0;
}
.initial-box{
  width: 90px;
  min-width: 90px;
  height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 0.75rem;
  padding: 0 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
}
.initial-text{ flex:1; }

/* Media consent alignment */
.consent-options{
  display:flex;
  align-items:center;
  gap:2rem;
  flex-wrap:wrap;
  margin-top: 0.75rem;
}
.consent-option{
  display:flex;
  align-items:center;
  gap:0.6rem;
  font-size:1rem;
  line-height:1.2;
}
.consent-option input{ transform: translateY(1px); }

/* NAV: keep a single row and prevent wrapping */
header nav, .navbar, .nav, nav.site-nav {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
}
.nav-links, nav ul{
  display:flex;
  align-items:center;
  gap: 1.25rem;
  flex-wrap:nowrap;
  white-space:nowrap;
}
.nav-links li, nav ul li{ white-space:nowrap; }
nav a[href="registration.html"]{
  padding:0.25rem 0.5rem;
  border-radius:0.5rem;
}

#signatureCanvas{background:#e9eef5;border:2px solid #8792a2;border-radius:0.75rem;}

#signatureCanvas{ touch-action:none; }

/* Signature section layout improvements */
#signatures .form-grid{
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
#signatures .form-field.signature-field{
  grid-column: 1 / span 2;
}
@media (max-width: 820px){
  #signatures .form-grid{ grid-template-columns: 1fr; }
  #signatures .form-field.signature-field{ grid-column: span 1; }
}

/* Birthdate dropdowns */
.birthdate-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .birthdate-grid{ grid-template-columns: 1fr; }
}
