@font-face {
  font-family: 'NT Somic';
  src: url('/app-static/fonts/NTSomic-Regular.woff2') format('woff2'),
       url('/app-static/fonts/NTSomic-Regular.woff') format('woff');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'NT Somic';
  src: url('/app-static/fonts/NTSomic-Medium.woff2') format('woff2'),
       url('/app-static/fonts/NTSomic-Medium.woff') format('woff');
  font-weight: 500; font-style: normal;
}
@font-face {
  font-family: 'NT Somic';
  src: url('/app-static/fonts/NTSomic-SemiBold.woff2') format('woff2'),
       url('/app-static/fonts/NTSomic-SemiBold.woff') format('woff');
  font-weight: 600; font-style: normal;
}
@font-face {
  font-family: 'NT Somic';
  src: url('/app-static/fonts/NTSomic-Bold.woff2') format('woff2'),
       url('/app-static/fonts/NTSomic-Bold.woff') format('woff');
  font-weight: 700; font-style: normal;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #020659;
  --primary-dark:   #010440;
  --primary-light:  #BEC9FA;
  --accent:         #7B0B56;
  --bg:             #F4F7FF;
  --card:           #ffffff;
  --text:           #1c1c1e;
  --text-secondary: #636366;
  --border:         #e5e5ea;
  --nav-h:          60px;
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
  --radius:         14px;
  --shadow:         0 2px 12px rgba(2,6,89,.1);
  --shadow-sm:      0 1px 4px rgba(2,6,89,.06);
}

html { font-size: 16px; }
body {
  font-family: 'NT Somic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke: var(--primary); }


/* ===== PAGE TITLE ===== */
.page-header {
  padding: 20px 16px 12px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: 0 16px 16px;
}
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #f8bbd0, #fce4ec);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 48px;
}
.card-body { padding: 16px; }
.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}
.card-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-full { width: 100%; }
.btn-half { width: 50%; }
.btn-center { text-align: center; }
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* ===== EVENT CARD ===== */
.event-card { position: relative; }
.event-date-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--primary);
  color: #fff;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(194,24,91,.4);
}
.event-img-wrap { position: relative; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  text-align: center;
  gap: 12px;
}
.empty-state svg { opacity: .35; }
.empty-state p { font-size: 15px; }

/* ===== TAG FILTER CHIPS ===== */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  max-width: calc(100vw - 48px);
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(2, 6, 89, .18);
  box-shadow: 0 1px 4px rgba(2, 6, 89, .08);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.tag-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(2, 6, 89, .14);
}
.tag-chip:active { transform: scale(.96); }
.tag-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tag-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 14px rgba(2, 6, 89, .30);
}
.tag-chip.active::after {
  content: '✓';
  font-size: 11px;
  font-weight: 700;
  opacity: .9;
}
.tag-chip:disabled,
.tag-chip[aria-disabled="true"] {
  opacity: .45;
  pointer-events: none;
  box-shadow: none;
}

/* ===== MATERIALS – VIDEO PLAYER ===== */
.video-card { margin: 0 16px 16px; }
.video-meta { padding: 12px 16px 4px; }
.video-meta-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.video-meta-author { font-size: 13px; color: var(--text-secondary); }
.video-meta-desc { font-size: 13px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}
.video-wrap iframe,
.video-wrap video {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

.video-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.video-poster {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.play-btn {
  position: relative;
  z-index: 3;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform .15s;
}
.play-btn:hover { transform: scale(1.08); }
.play-btn svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }

/* ===== COURSE LANDING PAGE ===== */
.landing-hero { position: relative; }
.landing-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.landing-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 50%);
}
.landing-hero-text {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 16px;
  color: #fff;
}
.landing-hero-text h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.landing-section { padding: 20px 16px; }
.landing-section + .landing-section { border-top: 1px solid var(--border); }
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -.3px;
}

.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
}
.check-list li::before {
  content: '';
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

.structure-block { margin-bottom: 16px; }
.structure-block-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.structure-item {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--primary-light);
  margin-bottom: 4px;
  line-height: 1.4;
}

/* reviews slider */
.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--primary);
}

/* ===== TARIFF CARDS ===== */
.tariffs-grid { display: flex; flex-direction: column; gap: 14px; }
.tariff-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.tariff-card.highlighted {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(194,24,91,.18);
}
.tariff-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 50px;
  letter-spacing: .5px;
  white-space: nowrap;
}
.tariff-name {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: .5px;
}
.tariff-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 14px;
}
.tariff-features {
  list-style: none;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tariff-features li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.45;
}
.tariff-features li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== CARD TAGS (теги на карточке) ===== */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

/* Маленькие теги на карточке: заливка primary-light — чётко видна на белом фоне карточки */
.card-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  background: var(--primary-light);   /* #BEC9FA — хорошо виден на белом */
  color: var(--primary);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(2, 6, 89, .10);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.card-tag:active {
  background: var(--primary);
  color: #fff;
}
