/* ===========================
   CasperAi — Section 2: Features
   =========================== */

.features-section {
  padding: 44px 0;
  background: transparent;
}

.features-head {
  max-width: 1320px;
  margin: 0 auto 32px;
  padding: 0 60px;
}

.features-head-left {
  max-width: 820px;
}

.features-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #eaf0fb;
  color: var(--brand);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}
.features-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
}

.features-title {
  font-family: 'Unbounded', 'Manrope', sans-serif;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--ink);
  text-wrap: balance;
}
.features-title em {
  font-style: normal;
  color: var(--brand);
}

.features-sub {
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  max-width: 640px;
}

.features-head-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.features-tag {
  padding: 10px 16px;
  border-radius: 999px;
  background: #f2f5fb;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.features-tag svg {
  width: 14px; height: 14px;
  color: var(--brand);
}

/* ===== Grid =====
   Layout:
   [ 01 Setup (tall) | 02 Knowledge | 03 Speed ]
   [ 01 Setup cont'd | 04 Integr.   | 05 Growth ]
*/
.features-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.f-card {
  position: relative;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.f-card:hover {
  transform: translateY(-4px);
}

.f-card-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin-bottom: 6px;
}

.f-card-title {
  font-family: 'Unbounded', 'Manrope', sans-serif;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 8px;
}

.f-card-desc {
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.75;
  margin: 0;
  max-width: 420px;
}

/* Карточка 01: заголовок слева, описание справа */
.f-setup-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}
.f-setup-head .f-card-desc { max-width: none; }
.sv-break { flex-basis: 100%; height: 0; }

/* Мельче содержимое в карточках 02/03/04-05 */
.f-knowledge .f-card-title,
.f-integrations .f-card-title,
.f-combo .f-card-title { font-size: 21px; }
.f-knowledge .f-card-desc,
.f-integrations .f-card-desc,
.f-combo .f-card-desc { font-size: 13.5px; }

/* ===== LARGE: Setup (col 1, row 1/3) ===== */
.f-setup {
  grid-column: 1 / -1;
  grid-row: 1;
  background: linear-gradient(155deg, #eef3fb 0%, #dfe8f6 100%);
  color: var(--ink);
  border: 1px solid rgba(45, 110, 247, 0.12);
  overflow: visible;
  position: relative;
  z-index: 5;
}
.f-setup .setup-visual { overflow: visible; }
.f-setup .sv-dropdown.is-open { z-index: 30; }
.f-setup .f-card-label { color: var(--brand); opacity: 1; }

.setup-visual {
  margin-top: 14px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 26px;
  align-content: start;
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 40px -20px rgba(20, 35, 90, 0.2);
  border: 1px solid rgba(45, 110, 247, 0.1);
}
.sv-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: svIn 0.55s ease-out backwards;
}
.sv-field:nth-child(1) { animation-delay: 0.05s; }
.sv-field:nth-child(2) { animation-delay: 0.12s; }
.sv-field:nth-child(3) { animation-delay: 0.19s; }
.sv-field:nth-child(4) { animation-delay: 0.26s; }
.sv-field:nth-child(5) { animation-delay: 0.33s; }
.sv-field:nth-child(6) { animation-delay: 0.4s; }
@keyframes svIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.sv-label-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.sv-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Unbounded', 'Manrope', sans-serif;
  letter-spacing: -0.01em;
}
.sv-hint {
  font-size: 11px;
  color: var(--muted);
}
.sv-select {
  width: 100%;
  padding: 10px 14px;
  background: #f7f9fd;
  border: 1px solid rgba(45, 110, 247, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: left;
}
.sv-select:hover {
  background: #eef3fb;
  border-color: var(--brand);
}
.sv-select svg {
  color: var(--muted);
  transition: transform 0.2s;
  flex: none;
}
.sv-dropdown {
  position: relative;
}
.sv-dropdown.is-open .sv-select svg { transform: rotate(180deg); }
.sv-dropdown.is-open .sv-select {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 110, 247, 0.1);
}
.sv-dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(45, 110, 247, 0.18);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 6px;
  box-shadow: 0 20px 40px -16px rgba(20, 35, 90, 0.22);
  z-index: 10;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  max-height: 220px;
  overflow-y: auto;
}
.sv-dropdown.is-open .sv-dropdown-list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sv-dropdown-list li {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s;
}
.sv-dropdown-list li:hover { background: #f2f5fb; }
.sv-dropdown-list li.is-selected {
  background: rgba(45, 110, 247, 0.1);
  color: var(--brand);
  font-weight: 600;
}

.sv-other-input {
  width: 100%;
  padding: 10px 14px;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--brand);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  font-family: inherit;
  outline: none;
  display: none;
  animation: svIn 0.3s ease-out;
  box-shadow: 0 0 0 3px rgba(45, 110, 247, 0.1);
}
.sv-other-input.is-visible { display: block; }
.sv-other-input::placeholder { color: var(--muted); font-weight: 400; }

.sv-input {
  position: relative;
  padding: 10px 14px;
  background: #f7f9fd;
  border: 1px solid rgba(45, 110, 247, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  min-height: 38px;
  outline: none;
  cursor: text;
  transition: border-color 0.2s, background 0.2s;
}
.sv-input:hover { background: #eef3fb; }
.sv-input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 110, 247, 0.12);
}

.sv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sv-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f2f5fb;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.sv-chip.sm {
  font-size: 11px;
  padding: 5px 10px;
}
.sv-chip.is-active {
  background: #1a2347;
  color: #fff;
  border-color: #1a2347;
  box-shadow: 0 4px 12px -4px rgba(45, 110, 247, 0.35);
}
.sv-chip:hover:not(.is-active) {
  background: #e6edf8;
  border-color: rgba(45, 110, 247, 0.2);
}
.sv-chip-ghost {
  background: transparent;
  border: 1px dashed rgba(45, 110, 247, 0.35);
  color: var(--brand);
}
.sv-subrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.sv-sublabel {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
}

/* ===== Knowledge (compact, col 2, row 1) ===== */
.f-knowledge {
  grid-column: auto;
  grid-row: auto;
  background: linear-gradient(155deg, #eef3fb 0%, #dfe8f6 100%);
  color: var(--ink);
  border: 1px solid rgba(45, 110, 247, 0.12);
}
.f-knowledge .f-card-label { color: var(--brand); opacity: 1; }

.knowledge-visual {
  margin-top: auto;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 40px -20px rgba(20, 35, 90, 0.2);
  border: 1px solid rgba(45, 110, 247, 0.1);
}
.kv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.kv-head-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kv-head-title svg { color: var(--brand); }

.kv-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.kv-upload-btn:hover { background: var(--brand-dark); }

.kv-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kv-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fd;
  border: 1px solid transparent;
  animation: kvFileIn 0.5s ease-out backwards;
  transition: all 0.2s;
}
.kv-file:hover {
  background: #eef3fb;
  border-color: rgba(45, 110, 247, 0.2);
}
@keyframes kvFileIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kv-file:nth-child(1) { animation-delay: 0.1s; }
.kv-file:nth-child(2) { animation-delay: 0.2s; }
.kv-file:nth-child(3) { animation-delay: 0.3s; }
.kv-file:nth-child(4) { animation-delay: 0.4s; }

.kv-file-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}
.kv-file-icon.pdf { background: #e94c3c; }
.kv-file-icon.xls { background: #1d8e5c; }
.kv-file-icon.doc { background: #2d6ef7; }
.kv-file-icon.txt { background: #6b7390; }

.kv-file-meta { flex: 1; min-width: 0; }
.kv-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kv-file-size {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.kv-file-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: #eaf7ef;
  color: #16a34a;
}
.kv-file-status.loading {
  background: #fff4e5;
  color: #d97706;
}
.kv-file-status .tick {
  width: 10px; height: 10px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== DARK CARDS (base) ===== */
.f-dark {
  background: linear-gradient(160deg, #14193a 0%, #0b1330 100%);
  color: #fff;
}
.f-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(45, 110, 247, 0.25), transparent 50%);
  pointer-events: none;
}
.f-dark > * { position: relative; z-index: 1; }
.f-dark .f-card-label { color: rgba(255,255,255,0.55); }

/* ===== Instant replies (chart: animated bars) ===== */
.f-instant {
  grid-column: 1;
  grid-row: 3;
}
.bars-chart {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-top: 20px;
}
.bar {
  flex: 1;
  background: linear-gradient(180deg, #3a7bfc 0%, #2d6ef7 100%);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  animation: barGrow 1.2s cubic-bezier(.2,.8,.2,1) backwards;
  box-shadow: 0 0 20px rgba(45, 110, 247, 0.4);
}
.bar::after {
  content: attr(data-val);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
}
.bar:nth-child(1) { height: 30%; animation-delay: 0.1s; opacity: 0.5; }
.bar:nth-child(2) { height: 55%; animation-delay: 0.2s; opacity: 0.65; }
.bar:nth-child(3) { height: 45%; animation-delay: 0.3s; opacity: 0.75; }
.bar:nth-child(4) { height: 75%; animation-delay: 0.4s; }
.bar:nth-child(5) { height: 90%; animation-delay: 0.5s; }
.bar:nth-child(6) { height: 100%; animation-delay: 0.6s; background: linear-gradient(180deg, #f4b1e8 0%, #2d6ef7 100%); }
@keyframes barGrow {
  from { height: 0%; opacity: 0; }
}

/* ===== Integrations (logo cloud) ===== */
.f-integrations {
  grid-column: auto;
  grid-row: auto;
}

/* Объединённая карточка 04+05 */
.f-combo { display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.f-combo-item { display: flex; flex-direction: column; }
.f-combo-divider { height: 1px; background: rgba(255,255,255,0.12); }
.int-cloud {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.int-logo {
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  transition: all 0.25s;
  animation: intPulse 3s infinite;
}
.int-logo svg { width: 22px; height: 22px; }
.int-logo:hover {
  background: rgba(45, 110, 247, 0.2);
  border-color: rgba(45, 110, 247, 0.4);
  color: #fff;
  transform: scale(1.05);
}
.int-logo:nth-child(1) { animation-delay: 0s; }
.int-logo:nth-child(2) { animation-delay: 0.3s; }
.int-logo:nth-child(3) { animation-delay: 0.6s; }
.int-logo:nth-child(4) { animation-delay: 0.9s; }
.int-logo:nth-child(5) { animation-delay: 1.2s; color: #6ab3f3; }
.int-logo:nth-child(6) { animation-delay: 1.5s; }
@keyframes intPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 110, 247, 0); }
  50% { box-shadow: 0 0 0 3px rgba(45, 110, 247, 0.1); }
}

/* ===== Results — removed ===== */

/* ===== 24/7 Growth chart ===== */
.f-growth {
  grid-column: 2;
  grid-row: 3;
}
.growth-chart {
  margin-top: auto;
  position: relative;
  height: 140px;
}
.growth-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.growth-line {
  fill: none;
  stroke: url(#growthGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: growthDraw 2s ease-out 0.3s forwards;
}
@keyframes growthDraw {
  to { stroke-dashoffset: 0; }
}
.growth-area {
  fill: url(#growthArea);
  opacity: 0;
  animation: growthFill 1.2s ease-out 1.5s forwards;
}
@keyframes growthFill {
  to { opacity: 1; }
}
.growth-dot {
  fill: #f4b1e8;
  opacity: 0;
  animation: dotShow 0.4s ease-out forwards;
  filter: drop-shadow(0 0 8px rgba(244, 177, 232, 0.8));
}
@keyframes dotShow {
  to { opacity: 1; }
}
.growth-tag {
  position: absolute;
  top: -2px;
  right: 0;
  padding: 5px 10px;
  background: rgba(244, 177, 232, 0.2);
  border: 1px solid rgba(244, 177, 232, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #f4b1e8;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .features-section { padding: 26px 0; }
  .features-head, .features-grid { padding: 0 40px; }
  .setup-visual { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
  .f-setup,
  .f-knowledge,
  .f-instant,
  .f-integrations,
  .f-growth {
    grid-column: 1;
    grid-row: auto;
  }
}
@media (max-width: 640px) {
  .features-section { padding: 24px 0; }
  .features-head, .features-grid { padding: 0 20px; }
  .features-grid { grid-template-columns: 1fr; }
  /* 3. убрать текст «Задайте цель…» в карточке 01 */
  .f-setup-head .f-card-desc { display: none; }
  /* На мобильных в форме карточки 01 оставляем только «Роль Casper» и «Роль ассистента» */
  .setup-visual .sv-field:nth-child(n+3) { display: none; }
  /* и убираем чип «Записать на пробный урок» */
  .setup-visual .sv-field:first-child .sv-chips .sv-chip:nth-child(2) { display: none; }
  /* 4. небольшой отступ между текстом и иконками в «Интеграции» */
  .f-integrations .int-cloud { margin-top: 16px; }
  .f-setup,
  .f-knowledge,
  .f-instant,
  .f-integrations,
  .f-growth {
    grid-column: 1;
    grid-row: auto;
    min-height: 300px;
  }
}
