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

:root {
  --primary: #0f4567;
  --indigo-50: #eef4ff;
  --indigo-700: #3538cd;
  --gray-100: #f2f4f7;
  --gray-200: #f5f5f5;
  --gray-300: #d0d5dd;
  --gray-500: #667085;
  --gray-900: #101828;
  --secondary: #3b4553;
  --green: #5fa52e;
  --white: #ffffff;
  --border: rgba(0,0,0,0.1);
  --radius-card: 13px;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  color: var(--secondary);
}

/* ── LAYOUT ── */
.app {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 32px;
  max-width: 90%;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}

/* ── HEADER ── */
.header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
  align-self: center;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}
.header-top .badge-lang {
  position: absolute;
  right: 0;
}

.badge-program {
  background: var(--indigo-50);
  color: var(--indigo-700);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: background .15s;
}
.badge-program:hover { background: #dde8ff; }

.badge-lang {
  background: var(--gray-100);
  color: var(--secondary);
  font-size: 16px;
  font-weight: 600;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background .15s;
}
.badge-lang:hover { background: #e5e7eb; }

.header-titles { text-align: center; width: 100%; }
.header-titles h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.header-titles p {
  font-size: 18px;
  font-weight: 400;
  color: var(--gray-500);
}

/* ── SEARCH BAR ── */
.search-wrap { width: 320px; position: relative; }
.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 54px;
  height: 60px;
  padding: 10px 14px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,69,103,.12);
}
.search-input svg { flex-shrink: 0; color: var(--gray-500); }
.search-input input {
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--gray-500);
  width: 100%;
  background: transparent;
}
.search-input input::placeholder { color: var(--gray-500); }

/* Search dropdown */
.search-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 8px; max-height: 360px; overflow-y: auto;
  background: white; border-radius: 12px; border: 1px solid var(--gray-300);
  box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 1100; list-style: none;
  text-align: left;
}
.search-dropdown.open { display: block; }
.search-dropdown li {
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--gray-200);
  transition: background 0.1s;
}
.search-dropdown li:last-child { border-bottom: none; }
.search-dropdown li.active, .search-dropdown li:hover { background: var(--gray-100); }
.search-dropdown .sr-question { font-size: 14px; font-weight: 600; color: var(--gray-900); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-dropdown .sr-topic { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ── BODY LAYOUT ── */
.body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 350px;
  flex-shrink: 0;
  border-right: 0.5px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 16px;
  align-self: stretch;
}

.sidebar-section { display: flex; flex-direction: column; gap: 16px; padding-bottom: 12px; }

.sidebar-label {
  font-size: 14px;
  font-weight: 400;
  color: rgba(0,0,0,0.4);
  padding: 4px 12px;
  line-height: 20px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
  flex-wrap: wrap;
}
.sidebar-item:hover { background: rgba(0,0,0,.04); }
.sidebar-item.active { background: rgba(0,0,0,.04); }

.sidebar-item-text {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: black;
  line-height: 20px;
  min-width: 0;
}

.sidebar-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  padding: 2px 8px;
  border-radius: 16px;
  min-width: 34px;
  text-align: center;
  line-height: 19px;
}
.sidebar-badge.navy   { background: var(--primary); }
.sidebar-badge.green  { background: var(--green); }
.sidebar-badge.blue   { background: #2e6fa5; }
.sidebar-badge.orange { background: #e07b1a; }
.sidebar-badge.pink   { background: #d74490; }
.sidebar-badge.lime   { background: #7a9a2e; }

.sidebar-icon { width: 24px; height: 24px; flex-shrink: 0; }

/* ── MAIN CONTENT ── */
.main { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── CATEGORY HEADER ── */
.category-header {
  background: var(--primary);
  border-radius: 8px;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 8px;
  color: var(--white);
}
.category-header-icon { width: 24px; height: 24px; flex-shrink: 0; }
.category-header-title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
}
.category-header-count {
  font-size: 16px;
  font-weight: 400;
  color: var(--white);
  white-space: nowrap;
}
.category-header-count strong { font-weight: 700; }

/* ── ACCORDION ── */
.faq-item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-200);
}
.faq-item.open {
  border: 1px solid var(--gray-300);
  background: var(--white);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 60px;
  cursor: pointer;
  gap: 8px;
  user-select: none;
}

.faq-question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-500);
  flex: 1;
  line-height: normal;
}

.faq-number {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-500);
  flex-shrink: 0;
  margin-right: 4px;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform .25s ease;
  color: var(--gray-500);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 14px 24px;
  font-size: 14px;
  font-weight: 400;
  color: var(--secondary);
  line-height: 22px;
}
.faq-item.open .faq-answer { display: block; }

/* ── SEARCH HIGHLIGHT ── */
.faq-item.hidden { display: none; }
mark { background: #fff3b0; border-radius: 2px; padding: 0 1px; }

/* ── HEADER LOGO ── */
.header-top .logo-april {
  position: absolute;
  left: 0;
  height: 76px;
  width: auto;
}

/* ── FOOTER (outside card) ── */
.app-footer {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  max-width: 90%;
  margin: 0 auto;
}

/* ── PASSWORD OVERLAY ── */
.password-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #f8f9fa;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
}
.password-overlay.hidden { display: none; }
.password-box {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  max-width: 400px; width: 90%;
}
.password-box img { height: 60px; width: auto; }
.password-box h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 600; color: var(--gray-900);
  text-align: center;
}
.password-box p {
  font-size: 14px; color: var(--gray-500); text-align: center;
}
.password-box .pw-input {
  width: 100%; padding: 12px 16px; border-radius: 28px;
  border: 1px solid var(--gray-300); font-family: 'Inter', sans-serif;
  font-size: 15px; outline: none; text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.password-box .pw-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,69,103,.12);
}
.password-box .pw-input.error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,.12);
}
.password-box .pw-btn {
  width: 100%; padding: 12px; border-radius: 28px; border: none;
  background: var(--primary); color: white; font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.password-box .pw-btn:hover { background: #0d3a58; }
.password-box .pw-error {
  font-size: 13px; color: #e53e3e; min-height: 18px;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .app { padding: 16px; margin: 0; border-radius: 0; }
  .body { flex-direction: column; gap: 16px; }
  .sidebar { width: 100%; border-right: none; border-bottom: 0.5px solid var(--border); min-height: unset; padding: 8px 0; }
  .search-wrap { width: 100%; }
}
