@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:wght@300;400;500;600;700&family=Playpen+Sans:wght@100..800&family=Roboto:wght@100;300;400;500&display=swap');

html {
  scroll-behavior: smooth;
}

/* ==============================
   🔹 БАЗОВЫЕ ПЕРЕМЕННЫЕ
============================== */
:root {
  --bg: #fafafa;
  --bg-alt: #e9eef6;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #667085;
  --brand: #2ac0cf;
  --brand-2: #4eced9;
  --accent: #27c88d;
  --warning-bg: #fff7ed;
  --warning-border: #fdba74;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 6px 18px rgba(17, 24, 39, 0.08);

  --promo-grid-size: 34px;
  --promo-wave-depth: var(--promo-grid-size);
  --promo-grid-line: rgba(255, 255, 255, 0.34);
  --promo-edge-shadow: none;
  --promo-panel-bg:
    linear-gradient(45deg, transparent calc(50% - 1px), var(--promo-grid-line) calc(50% - 1px), var(--promo-grid-line) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / var(--promo-grid-size) var(--promo-grid-size),
    linear-gradient(-45deg, transparent calc(50% - 1px), var(--promo-grid-line) calc(50% - 1px), var(--promo-grid-line) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / var(--promo-grid-size) var(--promo-grid-size),
    linear-gradient(180deg, rgba(255, 105, 250, 0.28) 0%, rgba(255, 223, 249, 0.62) 100%),
    #f6e7ff;
}

/* ==============================
   🔹 БАЗОВЫЕ СТИЛИ
============================== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* ==============================
   🔹 КОНТЕЙНЕР
============================== */
.mybooks-container {
  max-width: 1280px;
  width: calc(100% - 32px);
  margin: 0 auto;
  padding: 10px 16px 16px 16px;
  min-height: calc(100vh - 240px);
}

@media (max-width: 900px) { .mybooks-container { padding: 14px; } }
@media (max-width: 520px) { .mybooks-container { width: calc(100% - 20px); padding: 2px 10px 10px 10px; } }

/* ==============================
   🔹 ЗАГОЛОВОК
============================== */
.page-title {
  margin: 24px 4px 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ==============================
   🔹 СЕТКА КНИГ
============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  align-items: stretch;
  margin-bottom: 60px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; gap: 20px; } }

/* ==============================
   🔹 КАРТОЧКИ КНИГ
============================== */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 2px 4px 4px 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, .12);
}

/* Обложка */
.cover-wrap { position: relative; background: #f2f4f8; }
.img_cover { width: 100%; display: block; border-radius: 2px 2px 2px 2px; }

/* Имитация корешка */
.book-spine { position: absolute; top: 0; height: 100%; pointer-events: none; border-radius: 4px; }
.book-spine.layer1 { left: 0; width: 3px; background: rgba(255,255,255,.8); filter: blur(.8px); }
.book-spine.layer2 { left: 3%; width: 1.5px; background: rgba(0,0,0,.09); filter: blur(1.6px); }
.book-spine.layer3 { left: 3.7%; width: 1.6px; background: rgba(0,0,0,.18); filter: blur(.7px); }

/* Плейсхолдер */
.no-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 4;
  background: linear-gradient(180deg, #eef2f7, #e6ebf3);
  color: #7b8794;
  font-size: 12px;
  text-transform: uppercase;
}

/* Название */
.book-title {
  padding: 12px 14px 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  word-wrap: break-word;
}

/* Метаданные */
.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px 10px;
  gap: 10px;
}
.book-meta__left {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

/* Нижняя панель */
.book-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 14px;
  margin-top: auto;
}

/* ==============================
   🔹 КНОПКИ
============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn:active { transform: translateY(1px); }

.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--light { background: #fff; color: #1a1a2e; border-color: #fff; }
.btn--light:hover { background: #fff; border-color: #fff; opacity: 0.88; }
.btn-pink { background: #f591a2 !important; border-color: #f3889a !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); }

/* ==============================
   🔹 ЦЕНЫ
============================== */
.price-tag,
.price-new {
  font-size: 16px;
  color: #d02a2a;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: bold;
  line-height: 1;
  white-space: nowrap;
}
.price-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.price-old {
  font-size: 14px;
  color: #6b7280;
  text-decoration: line-through;
}
@media (max-width: 520px) {
  .price-tag, .price-new { font-size: 15px; }
  .price-old { font-size: 13px; }
}

/* ==============================
   🔹 БЕЙДЖ СКИДКИ
============================== */
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 52px;
  border-radius: 7px;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at 30% 30%, black, black 65%);
  color: red;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(208,42,42,.28), inset 0 0 0 1px black;
}
@media (max-width: 520px) {
  .discount-badge {
    min-width: 44px;
    height: 44px;
    font-size: 14px;
    top: 8px;
    right: 8px;
  }
}

/* ==============================
   🔹 PROMO-БАННЕР
============================== */
.promo-banner {
  overflow: hidden;
  border-radius: 0;
  background: #c284e9;
  margin: 0 0 24px;
}

.promo-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
}

.promo-media {
  position: relative;
  display: flex;
  width: 100%;
  min-height: clamp(260px, 56vw, 460px);
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 216, 86, 0.32), transparent 26%),
    linear-gradient(135deg, #b37ae8, #7f45c4);
}

.promo-media video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: center;
}

.promo-media::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 30px;
  background: linear-gradient(180deg, transparent 0%, rgba(31, 18, 36, 0.48) 100%);
  content: "";
  pointer-events: none;
}

.promo-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 320px;
  margin-top: calc(0px - var(--promo-wave-depth));
  background: var(--promo-panel-bg);
  filter: var(--promo-edge-shadow);
  clip-path: path("M 0 17 C 17 17, 17 34, 34 34 C 51 34, 51 17, 68 17 C 85 17, 85 34, 102 34 C 119 34, 119 17, 136 17 C 153 17, 153 34, 170 34 C 187 34, 187 17, 204 17 C 221 17, 221 34, 238 34 C 255 34, 255 17, 272 17 C 289 17, 289 34, 306 34 C 323 34, 323 17, 340 17 C 357 17, 357 34, 374 34 C 391 34, 391 17, 408 17 C 425 17, 425 34, 442 34 C 459 34, 459 17, 476 17 C 493 17, 493 34, 510 34 C 527 34, 527 17, 544 17 C 561 17, 561 34, 578 34 C 595 34, 595 17, 612 17 C 629 17, 629 34, 646 34 C 663 34, 663 17, 680 17 C 697 17, 697 34, 714 34 C 731 34, 731 17, 748 17 C 765 17, 765 34, 782 34 C 799 34, 799 17, 816 17 C 833 17, 833 34, 850 34 C 867 34, 867 17, 884 17 C 901 17, 901 34, 918 34 C 935 34, 935 17, 952 17 C 969 17, 969 34, 986 34 L 4000 34 L 4000 4000 L 0 4000 Z");
}

.promo-copy {
  display: flex;
  position: relative;
  z-index: 2;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: calc(28px + var(--promo-wave-depth)) clamp(24px, 7vw, 56px) 36px;
}

.promo-copy .btn {
  align-self: flex-start;
}

.promo-eyebrow {
  margin: 0;
  color: #2b2b4c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.promo-title {
  margin: 0;
  color: #1a1a2e;
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 800;
  line-height: 0.98;
}

.promo-subtitle {
  max-width: 520px;
  margin: 0;
  color: #1e1e32;
  font-size: 16px;
  line-height: 1.55;
}

/* ==============================
   🔹 АДАПТИВНОСТЬ
============================== */
@media (min-width: 768px) {
  .promo-content {
    --promo-edge-shadow:
      drop-shadow(-9px 0 0 rgba(31, 18, 36, 0.34))
      drop-shadow(-18px 0 10px rgba(31, 18, 36, 0.48))
      drop-shadow(-38px 0 28px rgba(31, 18, 36, 0.46));
    flex-direction: row;
    min-height: clamp(430px, 39vw, 566px);
  }

  .promo-media {
    flex: 0 0 60%;
    min-height: inherit;
  }

  .promo-media::after {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 92px;
    height: auto;
    background: linear-gradient(90deg, transparent 0%, rgba(31, 18, 36, 0.46) 100%);
    clip-path: path("M 92 0 C 92 17, 75 17, 75 34 C 75 51, 92 51, 92 68 C 92 85, 75 85, 75 102 C 75 119, 92 119, 92 136 C 92 153, 75 153, 75 170 C 75 187, 92 187, 92 204 C 92 221, 75 221, 75 238 C 75 255, 92 255, 92 272 C 92 289, 75 289, 75 306 C 75 323, 92 323, 92 340 C 92 357, 75 357, 75 374 C 75 391, 92 391, 92 408 C 92 425, 75 425, 75 442 C 75 459, 92 459, 92 476 C 92 493, 75 493, 75 510 C 75 527, 92 527, 92 544 C 92 561, 80 566, 75 566 L 0 566 L 0 0 Z");
  }

  .promo-panel {
    flex: 0 0 calc(40% + var(--promo-wave-depth));
    min-height: inherit;
    margin-top: 0;
    margin-left: calc(0px - var(--promo-wave-depth));
    clip-path: path("M 34 0 C 34 17, 17 17, 17 34 C 17 51, 34 51, 34 68 C 34 85, 17 85, 17 102 C 17 119, 34 119, 34 136 C 34 153, 17 153, 17 170 C 17 187, 34 187, 34 204 C 34 221, 17 221, 17 238 C 17 255, 34 255, 34 272 C 34 289, 17 289, 17 306 C 17 323, 34 323, 34 340 C 34 357, 17 357, 17 374 C 17 391, 34 391, 34 408 C 34 425, 17 425, 17 442 C 17 459, 34 459, 34 476 C 34 493, 17 493, 17 510 C 17 527, 34 527, 34 544 C 34 561, 22 566, 17 566 L 4000 566 L 4000 0 Z");
  }

  .promo-copy {
    gap: 26px;
    padding: clamp(40px, 5vw, 76px) clamp(40px, 5vw, 76px) clamp(40px, 5vw, 76px) calc(clamp(40px, 5vw, 76px) + var(--promo-wave-depth));
  }

  .promo-title {
    max-width: 500px;
    font-size: clamp(34px, 3.2vw, 54px);
    line-height: 1.05;
  }
}

@media (min-width: 1280px) {
  .promo-content {
    height: 566px;
    min-height: 566px;
  }
}

@media (max-width: 520px) {
  .promo-banner { margin-bottom: 28px; }
  .promo-title { font-size: 32px; }
  .promo-subtitle { font-size: 14px; }
}

/* ==============================
   🔹 HOW IT WORKS
============================== */
:root {
  --how-grid-size: 34px;
  --how-grid-line: rgba(255, 255, 255, 0.34);
  --how-bg:
    linear-gradient(45deg, transparent calc(50% - 1px), var(--how-grid-line) calc(50% - 1px), var(--how-grid-line) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / var(--how-grid-size) var(--how-grid-size),
    linear-gradient(-45deg, transparent calc(50% - 1px), var(--how-grid-line) calc(50% - 1px), var(--how-grid-line) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / var(--how-grid-size) var(--how-grid-size),
    linear-gradient(180deg, rgba(105, 180, 255, 0.28) 0%, rgba(225, 240, 255, 0.50) 100%),
    #e7f1ff;
}

.how-it-works {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 90px 0 100px;
  background: var(--how-bg);
}

.how-it-works::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--how-grid-size);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='68' height='34' viewBox='0 0 68 34' preserveAspectRatio='none'><path d='M 0 0 L 0 17 C 17 17, 17 34, 34 34 C 51 34, 51 17, 68 17 L 68 0 Z' fill='%23fafafa'/></svg>");
  background-repeat: repeat-x;
  background-size: 68px 34px;
  pointer-events: none;
}

.how-it-works::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--how-grid-size);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='68' height='34' viewBox='0 0 68 34' preserveAspectRatio='none'><path d='M 0 17 C 17 17, 17 0, 34 0 C 51 0, 51 17, 68 17 L 68 34 L 0 34 Z' fill='%23ffffff'/></svg>");
  background-repeat: repeat-x;
  background-size: 68px 34px;
  pointer-events: none;
}

.how-spacer {
  width: 100%;
  height: 120px;
  background: #ffffff;
}

.how-it-works-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.how-it-works-title {
  margin: 0 0 50px;
  color: #1a1a2e;
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.how-step-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  height: 180px;
  margin-bottom: 5px;
  overflow: visible;
}

.how-step-num {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  transform: translate(calc(-100% - 50px), -50%);
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, "Arial Black", Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(108px, 13vw, 168px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.08),
    10px 10px 18px rgba(31, 18, 36, 0.18);
  pointer-events: none;
  user-select: none;
}

.how-step-visual img {
  display: block;
  position: relative;
  z-index: 1;
  width: 70%;
  max-width: 200px;
  height: 100%;
  object-fit: contain;
  margin-left: 28%;
}

.how-step-text {
  margin: 0;
  max-width: 240px;
  color: #1a1a2e;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.compare-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  margin-top: 70px;
}

.compare-slider {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 65%;
  max-width: 100%;
  justify-self: center;
  overflow: hidden;
  border-radius: 20px;
  background: #eee;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
}

.compare-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.compare-before {
  clip-path: inset(0 calc(100% - var(--compare-pos, 50%)) 0 0);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-pos, 50%);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.compare-handle-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: #1a1a2e;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25);
}

.compare-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compare-title {
  margin: 0;
  color: #1a1a2e;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.15;
}

.compare-desc {
  margin: 0;
  color: #4a4a5e;
  font-size: 16px;
  line-height: 1.55;
  max-width: 460px;
}

@media (max-width: 900px) {
  .how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 20px;
  }
}

@media (max-width: 760px) {
  .how-it-works {
    padding: 70px 0 100px;
  }

  .how-it-works-title {
    margin-bottom: 20px;
  }

  .how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
  }

  .how-step-visual {
    max-width: 220px;
    height: 140px;
    margin-bottom: -18px;
  }

  .how-step-visual img {
    max-width: 160px;
  }

  .how-step-num {
    font-size: clamp(84px, 22vw, 120px);
    transform: translate(-180%, -50%);
  }

  .compare-block {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 65px;
  }

  .compare-slider {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .compare-text {
    text-align: center;
    align-items: center;
  }

  .compare-desc {
    max-width: none;
  }
}

/* ==============================
   🔹 HOME FAQ
============================== */
.home-faq {
  background: #ffffff;
  padding: 60px 0 100px;
}

.home-faq__inner {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
}

.home-faq__title {
  margin: 0 0 28px;
  color: #1a1a2e;
  text-align: center;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.home-faq .mt-accordion {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .06);
}

.home-faq .mt-accordion__item {
  border-top: 1px solid #e5e7eb;
}
.home-faq .mt-accordion__item:first-child {
  border-top: none;
}

.home-faq .mt-accordion__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 700;
  color: #0f172a;
  position: relative;
  transition: background-color .2s ease, color .2s ease;
}
.home-faq .mt-accordion__summary::-webkit-details-marker { display: none; }
.home-faq .mt-accordion__summary::marker { content: ""; }

.home-faq .mt-accordion__summary::after {
  content: "";
  flex: 0 0 14px;
  margin-left: auto;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 15 12 9 18'/></svg>") no-repeat center / contain;
  transition: transform .2s ease, background-image .2s ease;
}

.home-faq .mt-accordion__item[open] .mt-accordion__summary {
  background: #f8fafc;
}
.home-faq .mt-accordion__item[open] .mt-accordion__summary::after {
  transform: rotate(90deg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 15 12 9 18'/></svg>");
}

.home-faq .mt-accordion__content {
  padding: 15px 18px 18px 18px;
  color: #334155;
  line-height: 1.65;
}
.home-faq .mt-accordion__content p { margin: 10px 0; }
.home-faq .mt-accordion__content a { color: #0ea5e9; text-decoration: none; }
.home-faq .mt-accordion__content a:hover { text-decoration: underline; }

.home-faq .mt-accordion__summary:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 520px) {
  .home-faq {
    padding: 40px 0 70px;
  }
}

