/* ===== Конструктор резюме ===== */

body.builder-body { background: #eef1f6; }

.b-top {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.b-top-in {
  display: flex; align-items: center; gap: 12px; height: 60px;
  max-width: 1500px; margin: 0 auto; padding: 0 16px;
}
.b-top .logo { font-size: 17px; }
.b-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.b-save-state { font-size: 12.5px; color: var(--muted); min-width: 90px; text-align: right; }

.b-wrap {
  display: grid; grid-template-columns: minmax(380px, 520px) 1fr;
  gap: 0; max-width: 1500px; margin: 0 auto; min-height: calc(100vh - 60px);
}

/* --- Левая панель: формы --- */
.b-panel { background: #fff; border-right: 1px solid var(--line); padding: 18px 18px 80px; }

.b-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.b-tab {
  padding: 9px 16px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font: 600 14px 'Inter', Arial, sans-serif; color: var(--muted);
}
.b-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.b-progress { margin-bottom: 16px; }
.b-progress-track { height: 8px; border-radius: 6px; background: #e9edf3; overflow: hidden; }
.b-progress-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 6px; transition: width .3s; }
.b-progress-label { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.b-sec {
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: #fff;
}
.b-sec-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer;
  user-select: none;
}
.b-sec-head h3 { margin: 0; font-size: 15.5px; flex: 1; }
.b-sec-ico { font-size: 18px; }
.b-sec-tools { display: flex; gap: 4px; align-items: center; }
.b-tool {
  border: none; background: #f1f5f9; color: var(--muted); width: 26px; height: 26px;
  border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1;
}
.b-tool:hover { background: #e2e8f0; color: var(--ink); }
.b-tool.hidden-on { background: #fee2e2; color: #b91c1c; }
.b-sec-body { padding: 0 14px 14px; display: none; }
.b-sec.open .b-sec-body { display: block; }
.b-sec.sec-hidden { opacity: .55; }
.b-sec-arrow { transition: transform .2s; color: var(--muted); }
.b-sec.open .b-sec-arrow { transform: rotate(90deg); }

.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.f-field { margin-bottom: 10px; }
.f-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.f-field input[type="text"], .f-field input[type="email"], .f-field select, .f-field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px;
  font: 400 14.5px 'Inter', Arial, sans-serif; color: var(--ink); background: #fff;
}
.f-field textarea { min-height: 84px; resize: vertical; }
.f-field input:focus, .f-field textarea:focus, .f-field select:focus {
  outline: none; border-color: var(--brand);
}
.f-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.f-item {
  border: 1px dashed #cbd5e1; border-radius: 10px; padding: 12px; margin-bottom: 10px;
  position: relative; background: #fafbfd;
}
.f-item-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.f-add {
  width: 100%; padding: 10px; border: 1.5px dashed var(--brand); background: #eff4ff;
  color: var(--brand); border-radius: 10px; cursor: pointer; font: 600 14px 'Inter', Arial, sans-serif;
}
.f-add:hover { background: #e0eaff; }

.f-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); }
.f-check input { width: 16px; height: 16px; }

.f-range { display: flex; align-items: center; gap: 10px; }
.f-range input[type="range"] { flex: 1; }
.f-range output { font-size: 13px; color: var(--muted); min-width: 42px; text-align: right; }

/* Подсказки-фразы */
.hint-box { background: #f0f7ff; border: 1px solid #cfe3ff; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.hint-box-title { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.hint-chip {
  display: inline-block; margin: 0 6px 6px 0; padding: 5px 10px; background: #fff;
  border: 1px solid #cfe3ff; border-radius: 16px; font-size: 12.5px; cursor: pointer; color: #1e40af;
}
.hint-chip:hover { background: var(--brand); color: #fff; }
.hint-select { margin-bottom: 6px; }

/* Фото */
.photo-drop {
  display: flex; align-items: center; gap: 14px;
}
.photo-drop .ph-preview {
  width: 74px; height: 74px; border-radius: 50%; background: #eef1f6 center/cover no-repeat;
  border: 1.5px solid var(--line); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #94a3b8;
}

/* --- Правая часть: предпросмотр --- */
.b-preview { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.b-preview-tools {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: #fff; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  position: sticky; top: 72px; z-index: 40; max-width: 100%;
}
.b-pv-group { display: flex; align-items: center; gap: 7px; }
.b-pv-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.color-dot {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line); flex: none;
}
.color-dot.active { box-shadow: 0 0 0 2.5px var(--brand); }
select.mini {
  padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px;
  font: 500 13px 'Inter', Arial, sans-serif; background: #fff; max-width: 170px;
}

.b-canvas {
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18); border-radius: 4px; overflow: hidden;
  max-width: 100%;
}
.b-canvas-scale { transform-origin: top left; }

/* Модалка выбора шаблона */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow: auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 1060px; width: 100%; padding: 26px;
}
.modal-head { display: flex; align-items: center; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 22px; flex: 1; }
.modal-close { border: none; background: #f1f5f9; width: 36px; height: 36px; border-radius: 10px; font-size: 17px; cursor: pointer; }
.modal .tpl-grid { grid-template-columns: repeat(4, 1fr); }
.tpl-card.active { outline: 3px solid var(--brand); }
.tpl-card .tpl-use {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(37, 99, 235, 0); transition: .15s; opacity: 0;
}
.tpl-card:hover .tpl-use { opacity: 1; background: rgba(15,23,42,.35); }

/* Модалка оплаты */
.pay-modal { max-width: 480px; text-align: center; }
.pay-modal .pay-price { font-size: 42px; font-weight: 800; margin: 6px 0; }
.pay-modal ul { text-align: left; margin: 14px auto 22px; max-width: 320px; padding-left: 0; list-style: none; }
.pay-modal li { padding: 5px 0 5px 26px; position: relative; }
.pay-modal li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.pay-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* Тосты */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14.5px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 90vw;
}
.toast.show { opacity: 1; }

/* premium-замок */
.lock-ico { font-size: 12px; }

@media (max-width: 1000px) {
  .b-wrap { grid-template-columns: 1fr; }
  .b-panel { border-right: none; padding-bottom: 20px; }
  .b-preview { padding: 16px 8px 60px; }
  .b-preview-tools { position: static; }
  .modal .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
