:root {
  --brand: #3d9ea3;
  --brand-dark: #2d7f84;
  --brand-fg: #f7fcfc;
  --navy: #24365a;
  --navy-soft: #2f4470;
  --gold: #e4c04a;
  --gold-fg: #24365a;
  --bg: #f7fafb;
  --fg: #1e2a3a;
  --muted: #f0f5f6;
  --muted-fg: #6b7c8a;
  --card: #ffffff;
  --border: #e2eaf0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(36, 54, 90, 0.08);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; opacity: .95; }
.btn-brand { background: var(--brand); color: var(--brand-fg); }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--muted); }
.btn-secondary { background: var(--muted); color: var(--fg); }
.btn-gold { background: var(--gold); color: var(--gold-fg); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 600;
  background: var(--muted); color: var(--muted-fg);
}
.badge-brand { background: rgba(61,158,163,.15); color: var(--brand); }
.badge-gold { background: rgba(228,192,74,.25); color: #8a6b10; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-body { padding: 16px 18px; }
.card-header {
  padding: 14px 18px 0; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-title { margin: 0; font-size: 15px; font-weight: 700; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .md-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--fg);
}
.form-control:focus { outline: 2px solid rgba(61,158,163,.35); border-color: var(--brand); }
.form-hint { font-size: 11px; color: var(--muted-fg); margin-top: 4px; }

.progress {
  height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%; background: var(--brand); border-radius: 999px;
}

/* Auth layout */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 900px) {
  .auth-page { flex-direction: row; }
}
.auth-form-wrap {
  flex: 1; display: flex; flex-direction: column; position: relative;
  padding: 40px 28px 120px; background: #f8fdfd;
}
.auth-form-inner { width: 100%; max-width: 380px; margin: auto; padding-top: 48px; }
.auth-hero {
  flex: 1; background: var(--brand); color: var(--brand-fg);
  display: none; flex-direction: column; padding: 40px;
}
@media (min-width: 900px) { .auth-hero { display: flex; } }
.auth-hero-mobile {
  background: var(--brand); color: var(--brand-fg); padding: 24px 20px;
}
@media (min-width: 900px) { .auth-hero-mobile { display: none; } }
.auth-logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--navy); font-weight: 800; letter-spacing: .02em;
  border-radius: 8px; /*padding: 10px 16px;box-shadow: var(--shadow);*/
}
.auth-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; margin-bottom: 16px;
}
.auth-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.role-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px; padding: 4px;
}
.role-toggle label {
  text-align: center; padding: 8px; border-radius: 8px; font-size: 12px;
  font-weight: 700; cursor: pointer; color: var(--muted-fg);
}
.role-toggle input { display: none; }
.role-toggle input:checked + span {
  display: block; background: var(--brand); color: #fff; border-radius: 8px; padding: 8px;
}
.role-toggle span { display: block; padding: 8px; }
.partner-box {
  border-radius: 16px; background: var(--muted); padding: 14px; margin-top: 24px;
}
.partner-box p {
  text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted-fg); margin: 0 0 10px;
}
.partner-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.partner-logos img {
  flex: 1 1 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.partner-logos span {
  font-size: 11px; font-weight: 700; color: var(--navy); background: #fff;
  border-radius: 8px; padding: 12px 6px;
}
.benefit-list { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; }
.benefit-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 8px; opacity: .92; text-align: left; }
.benefit-list li i { color: #F0C13E; flex-shrink: 0; line-height: 1; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--navy); color: #eef3f8;
  display: none; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
}
@media (min-width: 960px) { .sidebar { display: flex; } }
.sidebar-brand {
  height: var(--topbar-h); padding: 0 15px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center;
}
.sidebar-brand .auth-logo-mark { width: 100%; justify-content: flex-start; font-size: 13px; padding: 10px; }
.sidebar-brand .auth-logo-mark img { width: 100%; height: auto; max-height: 44px; object-fit: contain; padding: 0; }
.sidebar-nav { padding: 12px; flex: 1; overflow: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.85);
  font-size: 14px; margin-bottom: 4px; text-decoration: none;
}
.nav-item:hover { background: var(--navy-soft); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-item .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }

.main-wrap { flex: 1; min-width: 0; }
@media (min-width: 960px) { .main-wrap { margin-left: var(--sidebar-w); } }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-menu { position: relative; }
.user-menu-toggle {
  border: none; cursor: pointer; padding: 0; font: inherit; line-height: 1;
}
.user-menu-toggle:hover { opacity: .92; }
.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  width: 240px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; display: none;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-head {
  padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.user-menu-head .fw-bold { font-size: 14px; color: var(--fg); word-break: break-word; }
.user-menu-head .muted { margin-top: 2px; word-break: break-all; }
.user-menu-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px; color: var(--fg);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.user-menu-link:hover { background: var(--muted); text-decoration: none; }
.user-menu-link i { font-size: 16px; color: var(--muted-fg); }
.user-menu-logout { color: #b42318; }
.user-menu-logout i { color: #b42318; }
.user-menu-logout:hover { background: #fef3f2; }
.content { padding: 20px 16px 88px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 960px) { .content { padding: 24px 28px 40px; } }

.mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 960px) { .mobile-nav { display: none; } }
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--muted-fg); text-decoration: none; padding: 6px 2px;
}
.mobile-nav a.active { color: var(--brand); }

.page-title { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { margin: 0 0 20px; color: var(--muted-fg); font-size: 14px; }
.muted { color: var(--muted-fg); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.stack > * + * { margin-top: 10px; }
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted);
}
.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(61,158,163,.12); color: var(--brand); font-size: 12px; font-weight: 700;
}
.countdown-card {
  background: linear-gradient(145deg, var(--navy), #1a2740); color: #fff; border: none;
}
.countdown-num { font-size: 48px; font-weight: 800; line-height: 1; }
.accent-bar {
  height: 4px; border-radius: 999px; background: var(--brand); margin-bottom: 10px;
}
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state h2 { margin: 8px 0; }
.alert {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-info { background: #e0f2fe; color: #075985; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); }
.program-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: #fff;
}
.program-dot { width: 10px; height: 10px; border-radius: 50%; }
.select-inline {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff;
}
.hero-tryout {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; border: none;
}
.q-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; margin-bottom: 12px; }
.q-choices label {
  display: block; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px; cursor: pointer;
}
.q-choices input { margin-right: 8px; }
.q-choices label:hover { background: var(--muted); }
.correct { border-color: #10b981 !important; background: #ecfdf5 !important; }
.wrong { border-color: #ef4444 !important; background: #fef2f2 !important; }
.lang-switch a {
  display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  color: var(--muted-fg); border: 1px solid var(--border); margin-left: 4px;
}
.lang-switch a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.topbar .lang-switch a { background: #fff; }
.topbar .lang-switch a.active { background: var(--brand); color: #fff; }
.sidebar .lang-switch a { border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.sidebar .lang-switch a.active { background: var(--brand); color: #fff; }
