/* ==========================================================================
   freeconverter.ru — Дизайн-система (8px Grid, Современный SaaS UI)
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  
  --color-success: #16a34a;
  --color-success-light: #f0fdf4;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  
  --border-subtle: #e2e8f0;
  --border-focus: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-dropzone: 0 0 0 4px rgba(37, 99, 235, 0.12);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-logo .logo-badge {
  background: linear-gradient(135deg, var(--color-primary), #4f46e5);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
  padding: var(--space-1) 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
}

/* Breadcrumbs */
.breadcrumbs-nav {
  padding-top: var(--space-2);
  padding-bottom: var(--space-1);
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumbs-list a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs-list a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumbs-list .sep {
  color: var(--border-subtle);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: var(--space-2);
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Converter Card */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.dropzone-area {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  background-color: var(--bg-card-subtle);
  padding: var(--space-6) var(--space-3);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  box-shadow: var(--shadow-dropzone);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-2);
  color: var(--color-primary);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background-color: var(--color-primary);
  color: white;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-upload:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

.dropzone-hint {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Настройки сжатия (Compressor Settings Panel) */
.compress-options-panel {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.options-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-2);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.preset-card {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.preset-card:hover {
  border-color: #93c5fd;
}

.preset-card.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.preset-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Files List */
.files-list {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 12px var(--space-2);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
  flex: 1;
  min-width: 240px;
}

.file-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.file-size {
  color: var(--text-light);
  font-size: 0.85rem;
}

.file-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.format-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.format-select {
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: white;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.format-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.btn-action {
  background-color: var(--color-primary);
  color: white;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  margin-top: var(--space-3);
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.btn-action:hover {
  background-color: var(--color-primary-hover);
}

.btn-download {
  background-color: var(--color-success);
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-shadow: var(--shadow-md);
}

.btn-download:hover {
  background-color: #15803d;
}

.progress-container {
  margin-top: var(--space-3);
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  background: linear-gradient(90deg, var(--color-primary), #60a5fa);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* Semantic Content */
.content-section {
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
}

.section-heading {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: var(--space-3);
  text-align: center;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.spec-header {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.spec-content {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 800px;
  margin: var(--space-3) auto 0;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-primary);
  font-weight: 700;
  transition: transform 0.2s ease;
}

details[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 var(--space-3) var(--space-2);
  font-size: 0.95rem;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: var(--space-2);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background-color: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .specs-grid {
    grid-template-columns: 1fr;
  }
  .converter-card {
    padding: var(--space-2);
  }
  .file-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-controls {
    width: 100%;
    justify-content: space-between;
  }
}
