*{ box-sizing: border-box; }
html,body{ height: 100%; }
html{
  background: #f6dfe3;
}
body{
  margin: 0;
  color: #241b1f;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: transparent;
}
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('./assets/bg-main.png') center / cover no-repeat;
}

.app{
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100svh;
}

.page{ display: none; }
.page.active{ display: block; }

/* Главная: блок центрируется, отступ после плашки = 1.5 × gap карточек */
#home.active{
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: calc(100svh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
#home .title-plate img{
  width: 100%;
  height: auto;
  display: block;
}
.hero-subtitle{
  margin: 14px auto 0;
  max-width: 330px;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(90, 25, 45, .5), 0 0 2px rgba(90, 25, 45, .35);
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
}
#home .menu{
  margin-top: 24px;
  gap: 16px;
}

.title-plate{
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  background: rgba(255,255,255,.25);
}
.title-plate img{
  width: 100%;
  display: block;
}
.title-plate.small{
  margin-top: 48px;
  margin-bottom: 12px;
}

.menu{
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.img-btn{
  appearance: none;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.30);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
  min-height: 0;
  height: auto;
}
.img-btn img{
  width: 100%;
  height: auto;
  display: block;
}
.img-btn:active{ transform: translateY(1px); }
.wide{ grid-column: 1 / -1; }
.section-cta{
  display: block;
  width: 100%;
  margin-top: 12px;
}

.content-card{
  margin-top: 12px;
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(6px);
}
.content-card h3{
  margin: 14px 0 6px;
  font-size: 17px;
}
.content-card p{
  margin: 10px 0 0;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.5;
}
.content-card p:first-of-type{
  margin-top: 0;
}
.content-card ul{
  margin: 8px 0 0;
  padding-left: 18px;
}
.content-card li{
  margin: 6px 0;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.45;
}
.content-card strong{
  font-weight: 800;
}
h2{ margin: 0 0 8px; font-size: 20px; }
.muted{ opacity: .95; line-height: 1.45; }

/* Мягкое сердечко вместо яркого эмодзи */
.heart{
  color: #d894a4;
  font-style: normal;
}

.btn{
  appearance: none;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.75);
  color: #222;
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}

.btn.back-pill{
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 50;
  width: auto;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(92, 38, 52, .58);
  color: #fff2f5;
  border: 1px solid rgba(255,255,255,.38);
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 650;
}
.btn.back-pill:active{
  transform: none;
}

body.no-scroll{
  overflow: hidden;
}

/* Кейсы */
.cases-intro p{
  margin-top: 0;
}
.case-filters{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-top: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.case-filters::-webkit-scrollbar{
  display: none;
}
.case-chip{
  appearance: none;
  border: 1px solid rgba(92,38,52,.16);
  background: rgba(255,255,255,.66);
  color: #5c2634;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.case-chip span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(92,38,52,.10);
  font-size: 11px;
}
.case-chip.is-active{
  background: rgba(92,38,52,.88);
  border-color: rgba(255,255,255,.42);
  color: #fff2f5;
}
.case-chip.is-active span{
  background: rgba(255,255,255,.18);
}
.cases-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
  align-items: start;
}
.case-card{
  appearance: none;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.38);
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  backdrop-filter: blur(6px);
  min-width: 0;
}
.case-card:active{
  transform: translateY(1px);
}
.case-card__media{
  position: relative;
  aspect-ratio: 4 / 5;
  background: rgba(92,38,52,.10);
  overflow: hidden;
}
.case-card__media img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}
.case-count{
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(43,43,43,.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.case-card__body{
  padding: 10px;
}
.case-card__title{
  margin: 0;
  color: #43222b;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 750;
}
.case-card__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.case-badge{
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(92,38,52,.09);
  color: #6f4850;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}
.cases-empty{
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.38);
  color: #6f4850;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.case-modal{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.case-modal.is-open{
  display: block;
}
.case-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(31, 12, 18, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.case-modal__panel{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  max-height: calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: rgba(255,244,247,.96);
  box-shadow: 0 24px 80px rgba(0,0,0,.38);
  overflow: hidden;
}
.case-modal__close{
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(43,43,43,.72);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.case-modal__meta{
  padding: 14px 56px 10px 14px;
}
.case-modal__meta h3{
  margin: 0;
  color: #43222b;
  font-size: 16px;
  line-height: 1.25;
}
.case-modal__meta p{
  margin: 5px 0 0;
  color: #8a5a64;
  font-size: 12px;
  font-weight: 650;
}
.case-modal__stage{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: rgba(92,38,52,.08);
}
.case-modal__stage img{
  width: 100%;
  max-height: min(68svh, 680px);
  display: block;
  object-fit: contain;
  background: #fff;
}
.case-modal__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 40px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: rgba(43,43,43,.58);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.case-modal__nav--prev{ left: 10px; }
.case-modal__nav--next{ right: 10px; }
.case-modal__nav[hidden]{ display: none; }
.case-modal__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
}

@media (max-width: 360px){
  .cases-grid{
    grid-template-columns: 1fr;
  }
  .case-card__media{
    aspect-ratio: 4 / 4.7;
  }
}

/* Мини продукт */
.mini-article{
  padding-bottom: 108px;
}
.mini-article h3{
  margin: 18px 0 7px;
  color: #5c2634;
  font-size: 17.5px;
  line-height: 1.28;
}
.mini-article p{
  margin: 9px 0 0;
}
.mini-article ul{
  margin: 8px 0 0;
}
.mini-article blockquote{
  margin: 14px 0 0;
  padding: 12px 12px;
  border-left: 3px solid rgba(92,38,52,.55);
  border-radius: 12px;
  background: rgba(255,255,255,.3);
  color: #5c2634;
  font-weight: 650;
  line-height: 1.4;
}
.mini-note{
  color: #5c2634;
  font-weight: 750;
}

/* Тариф BASE в конце программы */
.mini-article .tariff-card{
  margin: 22px 0 0;
  padding: 16px 14px 15px;
  border-radius: 20px;
  border: 1px solid rgba(92,38,52,.16);
  background: linear-gradient(158deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.34) 55%, rgba(214,150,166,.22) 100%);
  box-shadow: 0 16px 34px rgba(43,12,22,.14), inset 0 1px 0 rgba(255,255,255,.65);
}
.mini-article .tariff-card__title{
  margin: 0;
  color: #5c2634;
  font-size: 18px;
  line-height: 1.28;
  font-weight: 850;
  letter-spacing: .01em;
}
.mini-article .tariff-seats{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 11px 0 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(92,38,52,.9);
  color: #fff2f5;
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(43,12,22,.20);
}
.tariff-seats__dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f5bcc9;
  box-shadow: 0 0 0 3px rgba(245,188,201,.28);
  animation: tariffPulse 2.4s ease-in-out infinite;
}
@keyframes tariffPulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: .35; }
}
@media (prefers-reduced-motion: reduce){
  .tariff-seats__dot{ animation: none; }
}
.mini-article .tariff-note{
  margin: 12px 0 0;
  color: #6f4850;
  font-size: 15.5px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}
.mini-article .tariff-text{
  margin: 9px 0 0;
  color: #43222b;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.45;
}
.mini-article .tariff-list{
  list-style: none;
  margin: 13px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.mini-article .tariff-list li{
  position: relative;
  margin: 0;
  padding-left: 23px;
  color: #33202a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.mini-article .tariff-list li::before{
  content: "♥︎";
  position: absolute;
  left: 0;
  top: 0;
  color: #d894a4;
  font-size: 14px;
  line-height: 1.6;
}
.pay-pill{
  appearance: none;
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  width: min(calc(100% - 32px), 528px);
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(92, 38, 52, .88);
  color: #fff2f5;
  box-shadow: 0 14px 34px rgba(0,0,0,.30);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
}
.pay-pill__price{
  padding-left: 11px;
  border-left: 1px solid rgba(255,255,255,.35);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pay-pill:active{
  transform: translateX(-50%) translateY(1px);
}

.mini-image{
  width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

/* Статус под кнопкой оплаты */
.pay-status{
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 61;
  width: min(calc(100% - 32px), 528px);
  margin: 0;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(43, 12, 22, .88);
  color: #fff2f5;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.pay-status[hidden]{ display: none; }
.pay-pill[disabled]{
  opacity: .68;
  cursor: default;
}

/* Экраны «оплата получена» / тестовая касса */
.state-card{
  text-align: center;
  padding: 22px 16px;
}
.state-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 13px 20px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(92, 38, 52, .9);
  color: #fff2f5;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.state-btn:disabled{ opacity: .6; }
.state-amount{
  margin: 16px 0 0;
  color: #5c2634;
  font-size: 30px;
  font-weight: 850;
}
.state-hint{
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.4;
}
.state-hint[hidden]{ display: none; }

/* Админка ручной выдачи доступа */
.admin-input{
  width: 100%;
  margin-top: 6px;
  padding: 12px 13px;
  border: 1px solid rgba(92,38,52,.22);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  color: #241b1f;
  font-size: 16px;
  font-family: inherit;
}
.admin-input:focus{
  outline: 2px solid rgba(92,38,52,.35);
  outline-offset: 1px;
}
.admin-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.admin-actions .state-btn{ margin-top: 0; }
.admin-actions .btn{ width: auto; margin-top: 0; padding: 12px 18px; }
.admin-status{
  margin-top: 12px;
  font-size: 14px;
  font-weight: 650;
  color: #5c2634;
}

/* Материалы (уроки) */
.lessons-list{
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.lesson-card{
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.lesson-card h3{
  margin: 0 0 4px;
  color: #5c2634;
  font-size: 17px;
  line-height: 1.28;
}
.lesson-sub{
  margin: 0 0 8px;
  color: #43222b;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
}
.lesson-desc{
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-line;
}
.lesson-video{
  width: 100%;
  display: block;
  border-radius: 14px;
  background: #2b1118;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.lesson-soon{
  display: none;
  margin: 0;
  padding: 16px 14px;
  border-radius: 14px;
  background: rgba(92,38,52,.08);
  color: #6f4850;
  text-align: center;
  font-size: 15px;
  font-weight: 650;
}
.lesson-card.is-empty .lesson-video{
  display: none;
}
.lesson-card.is-empty .lesson-soon{
  display: block;
}

/* Юридические страницы: оферта и политика */
.legal h2{ margin-bottom: 2px; }
.legal h3{ margin: 18px 0 6px; font-size: 16.5px; }
.legal p{ font-size: 15.5px; line-height: 1.55; }
.legal ul{ margin: 8px 0 0; padding-left: 18px; }
.legal li{ font-size: 15.5px; line-height: 1.5; margin: 6px 0; }
.legal a{ color: #5c2634; font-weight: 700; }
.legal-meta{ margin: 0 0 10px; font-size: 13px; opacity: .85; line-height: 1.4; }
.legal-fill{ color: #a24a5c; font-weight: 700; }

.legal-links{
  margin: 16px 0 104px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #5c2634;
}
.legal-links a{
  color: #5c2634;
  text-decoration: none;
  border-bottom: 1px solid rgba(92,38,52,.4);
  padding-bottom: 1px;
}
.legal-links span{ margin: 0 7px; opacity: .45; }
