/* pres-form.css — стили формы генерации презентаций.
 *
 * Общие для всех лендингов, где стоит форма (/presentations,
 * /prezentaciya-po-tekstu). Разметку рисует pres-form.js — если правите
 * классы здесь, смотрите и туда.
 *
 * Page-specific стили (примеры работ, отзывы, FAQ, футер) сюда не
 * переносим: они у каждого лендинга свои.
 */

:root {
  --brand: #7c3aed;
  --brand-soft: #ede9fe;
  --cta: #3bb6dc;
  --cta-hover: #2aa4ca;
  --ink: #0f172a;
}

/* ───────── Pill selects ───────── */
.pill-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.pill-select:hover { border-color: #cbd5e1; }
.pill-select .chev { color: #94a3b8; }

/* ───────── Form card ───────── */
.topic-card {
  background: #f8f9fb;
  border: 1px solid #eef0f4;
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
}

/* Подблоки карточки: «Ваш текст или файл» и «Тема». Каждый — белая плашка
   с подписью, чтобы поля не сливались в одну простыню. Кнопки остаются
   на сером фоне общей карточки. */
.field-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 11px 13px 12px;
}
.field-block + .field-block { margin-top: 10px; }
.field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.topic-textarea {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  font-size: 0.9375rem;
  line-height: 1.55;
  min-height: 60px;
  color: #0f172a;
}
.topic-textarea::placeholder { color: #9aa3b2; }

.create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--cta);
  color: #fff;
  border: 0;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .08s;
  box-shadow: 0 2px 6px rgba(59,182,220,0.25);
}
.create-btn:hover { background: var(--cta-hover); }
.create-btn:active { transform: translateY(1px); }
.create-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ───────── Source (file / text) attachment ───────── */
.source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}
.source-btn:hover { border-color: #c4b5fd; color: var(--brand); background: #fff; }
.source-btn .src-ico { color: #94a3b8; transition: color .15s; }
.source-btn:hover .src-ico { color: var(--brand); }
.source-btn.has-source {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: var(--brand);
}
.source-btn.has-source .src-ico { color: var(--brand); }

.source-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  padding: 6px;
  display: none;
}
.source-menu.open { display: block; }
.source-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
  font-size: 0.9375rem;
  border-radius: 8px;
  transition: background .12s;
}
.source-menu button:hover { background: #f5f3ff; }
.source-menu button .menu-ico { color: #7c3aed; flex-shrink: 0; }

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--brand);
  max-width: 100%;
}
.source-chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  font-weight: 500;
}
.source-chip .chip-meta { color: #7c3aed; opacity: .75; font-size: 0.8125rem; }
.source-chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: rgba(124,58,237,0.12);
  color: var(--brand);
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
}
.source-chip .chip-remove:hover { background: rgba(124,58,237,0.22); }

/* Рамку и фон даёт .field-block, здесь остаётся только показ/скрытие */
.source-text-wrap { display: none; }
.source-text-wrap.open { display: block; }
.source-text-wrap textarea {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  resize: vertical;
  font-size: 0.9375rem;
  line-height: 1.5;
  min-height: 96px;
  color: #0f172a;
}
.source-text-wrap textarea::placeholder { color: #9aa3b2; }
.source-text-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}
.source-text-foot .clear-text {
  background: transparent;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}
.source-text-foot .clear-text:hover { color: var(--brand); }
.source-text-foot.at-limit > span { color: #b45309; font-weight: 600; }
.source-text-warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #92400e;
}
.source-text-warn svg { color: #b45309; margin-top: 1px; }

/* Инфо-подсказка под chip-ом источника. Сейчас используется только
   для фото-форматов — предупреждаем, что OCR может занять до минуты,
   чтобы пользователь не подумал, что страница «зависла».
   Цвет — мягкий синий info, чтобы не путали с warn (жёлтым). */
.source-info-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #1e40af;
}
.source-info-hint svg { color: #2563eb; margin-top: 1px; }

@media (max-width: 767px) {
  .source-btn { padding: 8px 12px; font-size: 0.875rem; }
  .source-menu { min-width: 200px; }
  .source-chip .chip-name { max-width: 140px; }
}

/* ───────── Theme cards (copied from /app/presentations) ───────── */
.pres-theme-card {
  cursor: pointer;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  background: #fff;
}
.pres-theme-card:hover { border-color: #c4b5fd; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.pres-theme-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,0.18); transform: translateY(-2px); }

.pres-theme-preview-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f8f9fa;
  isolation: isolate;
}
.pres-theme-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

/* Each mini-slide inside the preview */
.tp-slide {
  border-radius: 4px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.tp-slide.tp-main {
  grid-column: 1 / -1;
  padding: 10px 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tp-slide .tp-accent-bar { width: 32%; height: 2px; border-radius: 1px; margin: 3px 0 4px; }
.tp-slide.tp-main .tp-accent-bar { width: 40%; height: 2.5px; margin: 4px auto 5px; }
.tp-slide .tp-h {
  font-size: 7px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-slide.tp-main .tp-h { font-size: 9.5px; margin-bottom: 2px; }
.tp-slide .tp-txt { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.tp-slide .tp-txt span { height: 2px; border-radius: 1px; display: block; }

.tp-chart { display: flex; align-items: flex-end; gap: 2px; margin-top: auto; padding-top: 3px; }
.tp-chart span { width: 5px; border-radius: 1px 1px 0 0; display: block; }

.tp-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: auto; padding-top: 3px; }
.tp-table span { height: 3px; border-radius: 1px; display: block; }

/* Unique template previews */
.pres-theme-preview.tpv-manifesto { display: block; padding: 0; background: #1a0606; }
.tpv-manifesto .tpv-photo {
  position: absolute; inset: 0;
  background: radial-gradient(110% 100% at 35% 50%, rgba(226,29,29,0.95) 0%, rgba(138,14,14,0.7) 30%, rgba(26,6,6,1) 70%);
}
.tpv-manifesto .tpv-photo::before {
  content: ""; position: absolute; left: -18%; top: 50%;
  transform: translateY(-50%); width: 68%; aspect-ratio: 1 / 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 42%),
              radial-gradient(circle at center, #2A0606 0%, #1A0404 58%, #0A0202 100%);
  box-shadow: 0 0 0 4px #0A0404, 0 10px 24px rgba(0,0,0,0.45);
}
.tpv-manifesto .tpv-photo::after {
  content: ""; position: absolute; left: calc(-18% + 24%); top: 50%;
  transform: translateY(-50%); width: 20%; aspect-ratio: 1 / 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #FF2E2E 0%, #C21818 60%, #8A0E0E 100%);
}
.tpv-manifesto .tpv-block {
  position: absolute; right: 6%; top: 14%; width: 52%;
  background: #ffffff; color: #0A0A0A; padding: 10px 12px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.tpv-manifesto .tpv-block::before {
  content: ""; display: block; width: 26px; height: 3px; background: #E11D1D; margin-bottom: 8px;
}
.tpv-manifesto .tpv-block .tpv-caps {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 9.5px; font-weight: 800; line-height: 1.15;
  text-transform: uppercase; letter-spacing: -0.005em; color: #0A0A0A;
}
.tpv-manifesto .tpv-block .tpv-sub {
  height: 2px; background: #D4D4D4; margin-top: 8px; width: 68%;
}

.pres-theme-preview.tpv-modern { display: block; padding: 0; background: #fff; }
.tpv-modern .tpv-bar { position: absolute; left: 0; top: 0; height: 16px; width: 100%; background: #0a0a0a; }
.tpv-modern .tpv-content { position: absolute; left: 10%; top: 38%; width: 80%; }
.tpv-modern .tpv-caps {
  font-family: 'Manrope', 'Inter', sans-serif;
  color: #0a0a0a; font-size: 13px; font-weight: 800; line-height: 1.05;
  text-transform: uppercase; letter-spacing: -0.01em;
}
.tpv-modern .tpv-accent { height: 3px; width: 36px; background: #fbbf24; margin-top: 6px; }
.tpv-modern .tpv-sub { height: 2px; width: 72%; background: #d0d0d0; margin-top: 8px; border-radius: 1px; }

.pres-theme-preview.tpv-arch {
  display: block; padding: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(143, 90, 44, 0.18) 3px 4px),
    #efe3cb;
}
.pres-theme-preview.tpv-arch::before {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(143, 90, 44, 0.4); pointer-events: none; z-index: 1;
}
.pres-theme-preview.tpv-arch::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238f5a2c' stroke-width='1'%3E%3Cpath d='M2 8 L2 2 L8 2'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238f5a2c' stroke-width='1'%3E%3Cpath d='M8 2 L14 2 L14 8'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238f5a2c' stroke-width='1'%3E%3Cpath d='M2 8 L2 14 L8 14'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238f5a2c' stroke-width='1'%3E%3Cpath d='M8 14 L14 14 L14 8'/%3E%3C/svg%3E");
  background-position: 3px 3px, calc(100% - 3px) 3px, 3px calc(100% - 3px), calc(100% - 3px) calc(100% - 3px);
  background-repeat: no-repeat;
  background-size: 16px 16px;
}
.tpv-arch .tpv-arch-shape {
  position: absolute; inset: 14px; background: #f5ead2; border-radius: 9999px;
  box-shadow: inset 0 0 0 1px rgba(143, 90, 44, 0.4),
              inset 0 0 0 3px #f5ead2,
              inset 0 0 0 4px rgba(143, 90, 44, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 14px; z-index: 3;
}
.tpv-arch .tpv-serif {
  font-family: 'PT Serif', 'Georgia', serif;
  color: #3d2e1f; font-size: 11px; font-weight: 700; line-height: 1.2;
  text-align: center; max-width: 92%;
}
.tpv-arch .tpv-arch-shape::after {
  content: ""; display: block; width: 26px; height: 8px; margin-top: 6px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='8' viewBox='0 0 26 8' fill='none' stroke='%238f5a2c' stroke-width='1'%3E%3Cpath d='M2 4 C5 1 7 7 10 4 C11 3 12 3 11 4 C10 5 12 5 13 4 C16 1 20 7 24 4'/%3E%3C/svg%3E") center/contain no-repeat;
}

.pres-theme-preview.tpv-blue { display: block; padding: 0; background: #ffffff; }
.tpv-blue .tpv-blue-card {
  position: absolute; inset: 16px;
  background:
    radial-gradient(120% 90% at 110% 10%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(135deg, #4263EB 0%, #3B4FD6 100%);
  border-radius: 18px; overflow: hidden; padding: 14px 14px 12px;
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: 0 6px 18px rgba(66, 99, 235, 0.35);
}
.tpv-blue .tpv-blue-card::before {
  content: ""; position: absolute; right: -22%; top: -18%; width: 140%; height: 140%;
  background:
    radial-gradient(closest-side at 38% 38%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 60%),
    repeating-radial-gradient(circle at 30% 30%,
      rgba(255,255,255,0) 0px, rgba(255,255,255,0) 14px,
      rgba(255,255,255,0.08) 14px, rgba(255,255,255,0.08) 15px);
  pointer-events: none;
}
.tpv-blue .tpv-blue-supertitle {
  position: relative; width: 72%; height: 2px;
  background: rgba(255,255,255,0.45); border-radius: 1px; margin-bottom: 8px;
}
.tpv-blue .tpv-blue-title {
  position: relative; color: #ffffff;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: -0.005em;
}

.pres-theme-label {
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
  text-align: center;
  border-top: 1px solid #f3f4f6;
}
.pres-theme-card.active .pres-theme-label { color: var(--brand); font-weight: 600; }

.pres-theme-check {
  position: absolute;
  bottom: 6px; left: 6px;
  width: 22px; height: 22px;
  background: var(--brand);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4;
  box-shadow: 0 1px 4px rgba(124,58,237,0.4);
}
.pres-theme-card.active .pres-theme-check { display: flex; }

/* ───────── Dropdown ───────── */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
  padding: 6px;
  z-index: 50;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.875rem;
  color: #0f172a;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.dropdown-menu button:hover { background: #f1f5f9; }
.dropdown-menu button.selected { background: #ede9fe; color: var(--brand); font-weight: 500; }

/* Fade up animation on scroll */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ═════════════ Mobile / Tablet adjustments ═════════════ */

/* Dropdown: keep inside viewport on small screens */
@media (max-width: 640px) {
  .dropdown-menu { min-width: 140px; max-width: calc(100vw - 32px); }
  #slides-select-wrap .dropdown-menu { left: 0; right: auto; }
}

@media (max-width: 768px) {
  .pill-select {
    padding: 8px 14px;
    font-size: 0.875rem;
    gap: 4px;
  }

  .create-btn {
    padding: 10px 18px;
    font-size: 0.9375rem;
    flex: 1 1 auto;
    justify-content: center;
  }

  .topic-card { padding: 14px 14px; border-radius: 16px; }
  .topic-textarea { min-height: 52px; font-size: 0.9375rem; line-height: 1.5; }
  .field-block { padding: 10px 11px 11px; border-radius: 12px; }

  .pres-theme-label { padding: 6px 8px; font-size: 11.5px; }
}

/* Extra-small phones */
@media (max-width: 420px) {
  .topic-card .flex { gap: 8px !important; }
  .pill-select { flex: 0 1 auto; justify-content: space-between; }
  .create-btn { flex: 1 1 auto; }

  .pres-theme-label { font-size: 11px; padding: 5px 6px; }
}
