/* Teme & Variabile cu Raport de Contrast Certificat WCAG AA (>= 4.5:1) */
:root[data-theme="dark"] {
  --bg: #090d16;
  --bg-surface: #111827;
  --card-bg: rgba(23, 32, 51, 0.75);
  --card-hover: rgba(30, 41, 59, 0.95);
  --card-border: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(9, 13, 22, 0.88);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --input-bg: #0f172a;
  --dropdown-bg: #111827;
  --dropdown-hover: #1e293b;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);

  /* Culori cu contrast ridicat pe fundal întunecat */
  --logo-sunt: #3b82f6;
  --logo-admis: #34d399; /* Contrast > 10:1 */
  --badge-text: #93c5fd; /* Contrast > 10:1 */
  --badge-bg: rgba(37, 99, 235, 0.16);
  --badge-border: rgba(96, 165, 250, 0.35);
  --dot-inactive: rgba(255, 255, 255, 0.35);
  --dot-active: #3b82f6;
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-hover: #ffffff;
  --card-border: rgba(15, 23, 42, 0.08);
  --header-bg: rgba(248, 250, 252, 0.88);
  --text: #0f172a;
  --text-muted: #475569; /* Contrast > 6:1 pe alb */
  --input-bg: #f1f5f9;
  --dropdown-bg: #ffffff;
  --dropdown-hover: #f1f5f9;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);

  /* Culori cu contrast ridicat pe fundal deschis (peste 4.5:1) */
  --logo-sunt: #1d4ed8; /* Contrast > 7:1 */
  --logo-admis: #047857; /* Verde smarald închis, Contrast > 4.7:1 */
  --badge-text: #1e40af; /* Contrast > 7.5:1 */
  --badge-bg: rgba(30, 64, 175, 0.08);
  --badge-border: rgba(30, 64, 175, 0.25);
  --dot-inactive: rgba(15, 23, 42, 0.3);
  --dot-active: #1d4ed8;
}

/* Culori Butoane */
:root {
  --blue-primary: #1d4ed8;
  --blue-hover: #1e40af;
  --green-primary: #047857;
  --green-hover: #065f46;
  --discord-bg: #5865f2;
  --discord-hover: #4752c4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Logo Bicolor Compact */
.logo, .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
}

.logo-icon {
  flex-shrink: 0;
  display: block;
}

.logo-text {
  display: inline-flex;
  align-items: baseline;
  letter-spacing: -0.4px;
}

.logo-sunt {
  color: var(--logo-sunt);
}

.logo-admis {
  color: var(--logo-admis);
}

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

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 13px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
}

/* Butoane */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
  margin-top: 10px;
}

.btn-mentor {
  background: linear-gradient(135deg, #2563eb, var(--blue-primary));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

.btn-mentor:hover {
  background: var(--blue-hover);
}

.btn-student {
  background: linear-gradient(135deg, #059669, var(--green-primary));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.3);
}

.btn-student:hover {
  background: var(--green-hover);
}

.btn-discord {
  background: var(--discord-bg);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.btn-discord:hover {
  background: var(--discord-hover);
}

/* Selector Temă Dropdown */
.theme-dropdown {
  position: relative;
}

.theme-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.theme-dropdown-trigger:hover {
  border-color: var(--blue-primary);
}

.theme-current-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-current-text {
  display: none;
}

.icon-caret {
  transition: transform 0.2s ease;
}

.theme-dropdown.open .icon-caret {
  transform: rotate(180deg);
}

.theme-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--dropdown-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  list-style: none;
  padding: 8px;
  min-width: 205px;
  box-shadow: var(--shadow);
  z-index: 200;
}

.theme-dropdown.open .theme-dropdown-menu {
  display: block;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-option:hover {
  background-color: var(--dropdown-hover);
}

.theme-option.active {
  color: var(--blue-primary);
  font-weight: 700;
}

/* Hero Rotator */
.hero-rotator {
  padding: 50px 0 20px 0;
  text-align: center;
  position: relative;
  min-height: 310px;
}

.hero-slide {
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hero-slide.active {
  display: block;
  opacity: 1;
}

/* Badge cu Tematică Albastră și Contrast Certificat */
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.2px;
  border: 1px solid var(--badge-border);
}

.hero-rotator h1,
.hero-title-rotative {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
  line-height: 1.22;
}

.hero-rotator p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.hero-cta-wrapper {
  margin-top: 22px;
}

.hero-cta {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Buline cu Suprafață Tactilă de 48px x 48px (Recomandare PageSpeed) */
.hero-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
}

.hero-dot {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.hero-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-inactive);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-dot.active::after {
  background: var(--dot-active);
  transform: scale(1.3);
}

/* Live Banner */
.live-banner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 28px 0 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .live-banner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.live-info h2 {
  font-size: 1.18rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pulse {
  width: 9px;
  height: 9px;
  background: var(--green-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(4, 120, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}

.live-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Grilă 15 Materii */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.4px;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 70px;
}

@media (min-width: 600px) {
  .subjects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .subjects-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.subject-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  transition: all 0.18s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.subject-card:hover {
  border-color: var(--blue-primary);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.15);
}

/* Modale */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  max-width: 490px;
  width: 100%;
  padding: 26px;
  position: relative;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.modal p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue-primary);
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  padding: 36px 0 24px 0;
  background: var(--bg-surface);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--blue-primary);
}

.footer-bottom {
  width: 100%;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--card-border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    box-shadow: var(--shadow);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu .btn {
    width: 100%;
    padding: 11px;
  }

  .theme-dropdown {
    width: 100%;
  }

  .theme-current-text {
    display: inline;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .theme-dropdown-trigger {
    width: 100%;
    padding: 11px 14px;
    justify-content: flex-start;
    gap: 12px;
  }

  .theme-dropdown-trigger .icon-caret {
    margin-left: auto;
  }

  .theme-dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 6px;
  }

  .hero-rotator {
    min-height: 350px;
  }
}