/* ==========================================================================
   УмКид — Reusable Components
   ========================================================================== */

/* --- Navigation ----------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(248, 250, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.nav.scrolled {
  background: rgba(248, 250, 255, 0.95);
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nav-logo-text .logo-um {
  color: var(--color-primary);
}

.nav-logo-text .logo-kid {
  color: var(--color-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-links a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
  background: rgba(55, 138, 221, 0.07);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.nav-burger:hover { background: rgba(55, 138, 221, 0.07); }

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out-soft), opacity 0.3s ease;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: rgba(248, 250, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  padding: var(--space-8) var(--space-6);
  gap: var(--space-2);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  transition:
    opacity 0.25s var(--ease-out-soft),
    transform 0.25s var(--ease-out-soft);
  pointer-events: none;
}

.nav-mobile.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.nav-mobile a {
  display: block;
  padding: var(--space-4) var(--space-4);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.nav-mobile a:hover {
  background: rgba(55, 138, 221, 0.08);
  color: var(--color-primary);
}

.nav-mobile-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.nav-mobile-actions .btn {
  justify-content: center;
}

@media (max-width: 1024px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: var(--space-2) var(--space-2); font-size: 14px; }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-actions .btn-outline { display: none; }
  .nav-burger { display: flex; }
  .nav-actions { gap: var(--space-2); }
}

@media (max-width: 480px) {
  .nav-actions .btn-primary { display: none; }
}

/* --- Footer --------------------------------------------------------------- */
.footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-24) 0 0;
  margin-top: var(--space-24);
}

/* В тёмной теме --color-text светлый, поэтому фон футера задаём явно */
[data-theme="dark"] .footer {
  background: #080C16;
  border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   Мелкий шрифт цены + реферальный блок (общий для index и pricing)
   ========================================================================== */
.pricing-fineprint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
  background: rgba(55, 138, 221, 0.06);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}

.referral-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  max-width: 940px;
  margin: 0 auto;
}

.referral-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s ease;
}

.referral-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.referral-card-accent {
  background: linear-gradient(160deg, rgba(239, 159, 39, 0.08), var(--color-surface) 60%);
  border-color: rgba(239, 159, 39, 0.3);
}

.referral-badge {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  background: var(--color-accent);
  color: #5a3d00;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.referral-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.referral-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: var(--space-2);
}

.referral-text {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.referral-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.referral-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.referral-list li span {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(55, 138, 221, 0.1);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
}

.referral-card-accent .referral-list li span {
  background: rgba(239, 159, 39, 0.15);
  color: #c07d00;
}

.referral-fineprint {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 12px;
  color: var(--color-text-light);
}

@media (max-width: 768px) {
  .referral-grid { grid-template-columns: 1fr; }
}


.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-12);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {}

.footer-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.footer-logo .logo-um { color: var(--color-primary-light); }
.footer-logo .logo-kid { color: var(--color-secondary-light); }

.footer-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  max-width: 220px;
  margin-bottom: var(--space-6);
}

.footer-socials {
  display: flex;
  gap: var(--space-3);
}

.footer-social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.footer-social-link:hover {
  background: rgba(55, 138, 221, 0.25);
  color: var(--color-primary-light);
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) 0;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

.footer-legal {
  display: flex;
  gap: var(--space-6);
}

.footer-legal a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Переключатель темы (светлая / тёмная)
   ========================================================================== */
.theme-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Иконки солнца/луны переключаются по теме */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.3s ease, transform 0.4s var(--ease-back);
}

.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* --- Тёмная тема: навигация ----------------------------------------------- */
[data-theme="dark"] .nav {
  background: rgba(13, 19, 32, 0.8);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(13, 19, 32, 0.95);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .nav-mobile {
  background: rgba(13, 19, 32, 0.98);
}

/* --- Subject Card --------------------------------------------------------- */
.subject-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition:
    transform 0.3s var(--ease-out-soft),
    box-shadow 0.3s var(--ease-out-soft),
    border-color 0.3s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.subject-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.subject-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text);
}

.subject-card-meta {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --- Accordion (FAQ) ------------------------------------------------------ */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.accordion-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.accordion-item.open {
  box-shadow: var(--shadow-md);
}

.accordion-trigger {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
}

.accordion-trigger:hover {
  background: rgba(55, 138, 221, 0.03);
}

.accordion-question {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
}

.accordion-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-primary);
  transition: transform 0.3s var(--ease-out-soft);
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out-soft), padding 0.3s ease;
}

.accordion-item.open .accordion-body {
  max-height: 400px;
}

.accordion-answer {
  padding: 0 var(--space-6) var(--space-5);
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* --- Star Rating ---------------------------------------------------------- */
.stars {
  display: flex;
  gap: 2px;
  color: var(--color-accent);
  font-size: 16px;
}

/* --- Progress Bar --------------------------------------------------------- */
.progress-bar {
  height: 8px;
  background: rgba(55, 138, 221, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-purple));
  transition: width 1s var(--ease-out-soft);
}

/* --- Avatar --------------------------------------------------------------- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* --- Toast / Notification ------------------------------------------------- */
.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
