:root {
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --accent: #0ea5e9;
  --bg: #f8fafc;
  --surface: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.logo {
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: var(--space-6);
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 150ms;
}

.nav a:hover {
  color: var(--brand);
}

/* Hero */
.hero {
  padding: var(--space-10) 0;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  color: var(--text);
}

.hero-subtitle {
  font-size: var(--step-1);
  color: var(--muted);
  margin-bottom: var(--space-6);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--brand);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all 150ms;
  border: none;
  cursor: pointer;
  font-size: var(--step-0);
}

.btn:hover {
  background: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn-ghost:hover {
  background: var(--brand);
  color: white;
}

.btn + .btn {
  margin-left: var(--space-3);
}

/* Constructor Grid */
.constructor-section {
  padding: var(--space-8) 0 var(--space-10);
}

.constructor-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-6);
  align-items: start;
}

.constructor-sidebar {
  background: var(--surface);
  border-radius: var(--radius-3);
  padding: var(--space-6);
  border: 1px solid var(--border);
  position: sticky;
  top: calc(80px + var(--space-4));
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.sidebar-header h2 {
  font-size: var(--step-2);
  font-weight: 700;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-2);
  color: var(--muted);
  transition: all 150ms;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Template Switcher */
.template-switcher {
  margin-bottom: var(--space-5);
}

.template-switcher label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.template-btn {
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: var(--radius-2);
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 600;
  transition: all 150ms;
  color: var(--text);
}

.template-btn:hover {
  background: var(--brand);
  color: white;
}

.template-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand-2);
}

/* Template Options */
.template-options {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-2);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--step--1);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Form Sections */
.form-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.section-header h3 {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-row:last-child {
  margin-bottom: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  font-size: var(--step-0);
  font-family: inherit;
  transition: all 150ms;
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input + input,
input + select {
  margin-top: var(--space-3);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Photo Upload */
.photo-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.btn-upload {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-2);
  cursor: pointer;
  font-weight: 600;
  transition: all 150ms;
  color: var(--text);
}

.btn-upload:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.photo-preview {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: var(--radius-2);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Repeater List */
.repeater-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.repeater-item {
  padding: var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-2);
  position: relative;
}

.repeater-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.repeater-item-header h4 {
  font-size: var(--step-0);
  font-weight: 600;
}

.btn-add {
  padding: var(--space-2) var(--space-4);
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 600;
  transition: all 150ms;
}

.btn-add:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
}

/* Tags List */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 40px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--brand);
  color: white;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 500;
}

.tag-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-remove:hover {
  opacity: 0.7;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Export Section */
.export-section {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
}

.btn-primary {
  flex: 1;
  padding: var(--space-4);
  font-size: var(--step-0);
  font-weight: 700;
}

/* Preview */
.constructor-preview {
  position: sticky;
  top: calc(80px + var(--space-4));
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius-2);
  border: 1px solid var(--border);
}

#zoomLevel {
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

.preview-wrapper {
  background: var(--surface-2);
  border-radius: var(--radius-3);
  padding: var(--space-6);
  overflow: auto;
  max-height: calc(100vh - 200px);
  display: flex;
  justify-content: center;
}

.preview-page {
  width: 210mm;
  min-height: 297mm;
  background: white;
  box-shadow: var(--shadow-3);
  transform-origin: top center;
  transition: transform 150ms;
}

/* Resume Templates Base */
.resume {
  padding: 20mm;
  font-size: 10pt;
  line-height: 1.4;
  color: #1f2937;
}

.resume h1 {
  font-size: 24pt;
  font-weight: 700;
  margin-bottom: 4pt;
  color: #111827;
}

.resume h2 {
  font-size: 14pt;
  font-weight: 600;
  margin-top: 12pt;
  margin-bottom: 6pt;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 4pt;
}

.resume h3 {
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 2pt;
}

.resume-header {
  margin-bottom: 16pt;
}

.resume-position {
  font-size: 16pt;
  color: #4b5563;
  margin-bottom: 8pt;
}

.resume-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8pt;
  font-size: 9pt;
  color: #6b7280;
  margin-bottom: 12pt;
}

.resume-photo {
  width: 80mm;
  height: 80mm;
  object-fit: cover;
  border-radius: 8pt;
  margin-bottom: 12pt;
}

.resume-section {
  margin-bottom: 16pt;
}

.experience-item,
.education-item {
  margin-bottom: 12pt;
}

.item-title {
  font-weight: 600;
  margin-bottom: 2pt;
}

.item-meta {
  font-size: 9pt;
  color: #6b7280;
  margin-bottom: 4pt;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6pt;
}

.skill-tag {
  display: inline-block;
  padding: 4pt 8pt;
  background: #f3f4f6;
  border-radius: 4pt;
  font-size: 9pt;
}

/* Features Section */
.features-section {
  padding: var(--space-10) 0;
  background: var(--surface);
}

.features-section h2 {
  text-align: center;
  font-size: var(--step-3);
  font-weight: 800;
  margin-bottom: var(--space-8);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  text-align: center;
  padding: var(--space-6);
  background: var(--bg);
  border-radius: var(--radius-3);
  border: 1px solid var(--border);
  transition: all 150ms;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card p {
  color: var(--muted);
  line-height: 1.6;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms;
}

.footer-nav a:hover {
  color: var(--brand);
}

/* Examples Page */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--space-6);
  transition: all 150ms;
}

.example-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.example-card h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.example-card p {
  color: var(--muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.salary-range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-2);
  margin-bottom: var(--space-4);
  font-weight: 600;
  color: var(--brand);
}

.skills-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.skill-badge {
  padding: var(--space-1) var(--space-2);
  background: var(--brand);
  color: white;
  border-radius: var(--radius-1);
  font-size: var(--step--1);
}

/* Profession Page */
.profession-hero {
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}

.profession-hero h1 {
  margin-bottom: var(--space-4);
}

.profession-content {
  padding: var(--space-8) 0;
}

.content-section {
  margin-bottom: var(--space-8);
}

.content-section h2 {
  font-size: var(--step-2);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-item {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}

.faq-item h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* Responsive */
@media (max-width: 1024px) {
  .constructor-grid {
    grid-template-columns: 1fr;
  }

  .constructor-sidebar {
    position: static;
    max-height: none;
  }

  .constructor-preview {
    position: static;
    order: -1;
  }

  .preview-page {
    width: 100%;
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .export-section {
    flex-direction: column;
  }

  .nav {
    gap: var(--space-4);
  }

  .hero h1 {
    font-size: 2rem;
  }
}