:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #10141d;
  --surface-2: #151b26;
  --surface-3: #1d2532;
  --text: #f3f6fb;
  --muted: #94a0b3;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #74d8bf;
  --accent-2: #8aa7ff;
  --warning: #ffbf6b;
  --error: #ff7b73;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #e6edf5;
  --text: #121722;
  --muted: #647084;
  --line: rgba(22, 31, 46, 0.12);
  --accent: #176f61;
  --accent-2: #3c63b8;
  --warning: #b96d16;
  --error: #b63b32;
  --shadow: 0 24px 60px rgba(31, 48, 70, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(116, 216, 191, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 4%, rgba(138, 167, 255, 0.13), transparent 26rem),
    var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand,
.main-nav,
.header-actions,
.trust-row,
.hero-actions,
.card-head,
.progress-meta,
.file-summary {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071014;
  font-size: 18px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
}

.main-nav a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  gap: 10px;
}

.text-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.toggle-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.converter-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  gap: 36px;
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 86px) clamp(16px, 4vw, 54px) 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 5.5vw, 66px);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  margin-bottom: 9px;
  font-size: 19px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.62;
}

.trust-row {
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.trust-row span,
.status-pill,
.formats-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trust-row span {
  padding: 9px 12px;
}

.hero-visual {
  display: block;
  width: min(520px, 100%);
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.converter-card,
.step-grid article,
.format-grid article,
.price-grid article,
.faq-list article,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.converter-card {
  padding: 22px;
}

.card-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
}

.converter-form {
  display: grid;
  gap: 16px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 26px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 44%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--surface-2);
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  position: relative;
  width: 64px;
  height: 78px;
  margin-bottom: 18px;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 14px;
  background: var(--surface);
}

.upload-icon::before {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 22px;
  height: 22px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 0 12px 0 8px;
  background: var(--surface-2);
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0 8px, var(--accent) 8px 12px, transparent 12px);
}

.dropzone strong,
.dropzone small {
  display: block;
}

.dropzone strong {
  font-size: 22px;
}

.dropzone small {
  margin-top: 8px;
  color: var(--muted);
}

.file-summary {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.file-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-3));
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.file-summary div:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.file-summary strong,
.file-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.clear-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid label,
.auth-form label {
  display: grid;
  gap: 8px;
}

.settings-grid label span,
.auth-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

select,
input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

select:focus,
input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.progress-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.progress-meta {
  justify-content: space-between;
  gap: 12px;
}

.progress-meta span {
  color: var(--accent);
  font-weight: 900;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.32s ease;
}

.progress-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  display: none;
  padding: 13px 14px;
  border-radius: 14px;
  line-height: 1.45;
}

.form-message.is-error {
  display: block;
  border: 1px solid color-mix(in srgb, var(--error) 36%, var(--line));
  background: color-mix(in srgb, var(--error) 11%, var(--surface));
  color: var(--error);
}

.form-message.is-info {
  display: block;
  border: 1px solid color-mix(in srgb, var(--accent-2) 32%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 11%, var(--surface));
  color: var(--accent-2);
}

.primary-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071014;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.76;
}

.button.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.workflow-section,
.subpage,
.formats-strip {
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 54px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 18px;
}

.step-grid,
.format-grid,
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-grid article,
.format-grid article,
.price-grid article,
.faq-list article {
  padding: 20px;
}

.step-grid article span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.step-grid p,
.format-grid span,
.price-grid p,
.faq-list p,
.subpage-head .lead {
  color: var(--muted);
  line-height: 1.55;
}

.formats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 10px;
  padding-bottom: 60px;
}

.formats-strip span {
  padding: 10px 14px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 54px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.subpage {
  min-height: calc(100vh - 160px);
}

.subpage-head {
  max-width: 760px;
  margin-bottom: 26px;
}

.format-grid article,
.price-grid article {
  display: grid;
  gap: 10px;
}

.format-grid strong,
.price-grid strong {
  font-size: 24px;
}

.price-grid article {
  min-height: 260px;
}

.price-grid .featured {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
}

.faq-list {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.auth-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 76px);
  padding: 30px 16px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 26px;
}

.auth-card h1 {
  font-size: 42px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 900;
}

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
  }

  .converter-hero {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .step-grid,
  .format-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand small {
    display: none;
  }

  .header-actions {
    width: 100%;
  }

  .theme-toggle,
  .text-link {
    flex: 1 1 0;
    justify-content: center;
  }

  .converter-card {
    padding: 16px;
  }

  .card-head,
  .file-summary,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dropzone {
    min-height: 190px;
  }
}
