/* Переопределяем токены под тёмную тему конструктора */
:root {
  --bg: #0c0e14;
  --surface: #1a1d26;
  --surface-2: #242834;
  --text: #e4e7ee;
  --muted: #8e94a5;
  --border: #2d313c;
  --brand: #3b82f6;
  --brand-2: #2563eb;
  --accent: #f97316;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  --radius-1: 6px;
  --radius-2: 10px;
  --radius-3: 16px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: var(--font-sans);
  --step-0: clamp(0.9rem, 1vw, 1rem);
  --mono-font: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Общие стили */
body { background: var(--bg); color: var(--text); }

.glass {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo .accent { color: var(--brand); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.burger-line { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; }

.constructor-page { padding-bottom: 3rem; }
.constructor-header { text-align: center; margin-bottom: 2rem; }
.constructor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.form-panel { 
  max-height: calc(100vh - 120px); 
  overflow-y: auto;
  padding-right: 0.5rem;
}
.form-scroll { display: flex; flex-direction: column; gap: 1rem; }
.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.preview-panel {
  position: sticky;
  top: 80px;
}
.preview-sticky { }
.preview-title { margin-bottom: 1rem; }

.a4-preview {
  background: white;
  color: #222;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  border-radius: var(--radius-2);
  overflow: hidden;
  aspect-ratio: 210 / 297;
  max-width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
}
.preview-content {
  padding: 20px 18px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transform-origin: top left;
  transform: scale(0.9); /* Масштабируем для умещения */
}
@media (min-width: 1024px) {
  .preview-content { transform: scale(0.85); }
}

/* Шаблоны резюме в предпросмотре */
.resume-sheet { 
  color: #1a1a1a;
}
.resume-header-sample { display: flex; gap: 15px; align-items: center; margin-bottom: 12px; }
.resume-photo img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; }
.resume-name { font-size: 18px; margin: 0; font-weight: 700; }
.resume-position { font-size: 14px; color: #444; margin: 2px 0; }
.resume-salary { font-weight: 600; color: #2c7a3c; }
.resume-contacts { font-size: 11px; color: #666; }
.resume-section { margin-top: 10px; }
.resume-section h3 { font-size: 13px; border-bottom: 1px solid #ccc; padding-bottom: 2px; margin-bottom: 6px; }
.exp-item { margin-bottom: 8px; }
.exp-header { font-weight: 600; }
.exp-period { color: #777; font-size: 11px; }

.template-options { flex-wrap: wrap; }
.template-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4em 0.9em;
  border-radius: var(--radius-1);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.template-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.variant-options { margin-top: 0.5rem; font-size: 0.85rem; display: flex; gap: 1rem; }
.variant-options label { cursor: pointer; }

/* Форма */
.field { margin-bottom: 0.8rem; }
.field-label { display: block; font-size: 0.8rem; margin-bottom: 0.15rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.section-title { font-size: 1rem; margin: 0 0 0.5rem; }

.repeatable-container { }
.repeatable-block {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.8rem;
  border-radius: var(--radius-2);
  margin-bottom: 0.8rem;
}
.remove-block {
  position: absolute;
  top: 5px; right: 8px;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
}

.tags-input { }
.tags-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.tags-list .tag {
  background: var(--brand);
  color: #fff;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.tag .tag-remove { cursor: pointer; opacity: 0.7; }
.tag .tag-remove:hover { opacity: 1; }

.photo-upload { display: flex; align-items: center; gap: 0.7rem; }
.photo-thumb { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Модальное окно оплаты */
.modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  justify-content: center;
  align-items: center;
}
.modal-overlay.open { display: flex; }
.modal-content {
  width: 90%;
  max-width: 420px;
  padding: 2rem;
  position: relative;
}
.modal-close { position: absolute; top: 10px; right: 15px; }
.payment-methods { margin-bottom: 1rem; }
.payment-option {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-1);
  font-size: 0.9rem;
}
.payment-option input[type="radio"] { accent-color: var(--brand); }
#cardFields { }
#cardFields .input { width: 100%; }

/* Стили для primery */
.sample-cards { }
.sample-card { display: block; text-decoration: none; color: inherit; transition: box-shadow 0.2s; }
.sample-card:hover { border-color: var(--brand); }
.sample-card-img { height: 120px; overflow: hidden; border-radius: var(--radius-2) var(--radius-2) 0 0; }
.sample-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sample-card h3 { margin: 0.8rem 0 0.3rem; }
.faq-section { margin-top: 3rem; }
.faq-item { margin-bottom: 1.5rem; }

/* Адаптив */
@media (max-width: 800px) {
  .constructor-layout { grid-template-columns: 1fr; }
  .preview-panel { position: relative; top: 0; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); padding: 1rem; }
  .mobile-menu-toggle { display: block; }
}