:root {
  --ink: #17233c;
  --muted: #78849a;
  --primary: #243f80;
  --primary-dark: #1a2f63;
  --accent: #f39325;
  --surface: #fff;
  --line: #e8ebf3;
  --background: #f6f8fc;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 4%, rgba(36, 63, 128, .09), transparent 34rem),
    var(--background);
  font-family: 'Cairo', system-ui, sans-serif;
}

.navbar {
  min-height: 76px;
  border-bottom: 1px solid rgba(226, 230, 240, .8);
  background: rgba(255, 255, 255, .72);
}

.navbar-brand {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.navbar-brand:hover {
  color: var(--ink);
}

.brand-logo {
  width: auto;
  height: 40px;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sound-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sound-toggle:hover {
  background: #edf1fa;
}

.sound-toggle svg {
  width: 20px;
  height: 20px;
}

.sound-toggle[aria-pressed="true"] .sound-cross,
.sound-toggle[aria-pressed="false"] .sound-waves {
  display: none;
}

.sound-toggle[aria-pressed="false"] {
  color: var(--muted);
}

.brand-accent,
.hero h1 span {
  color: var(--primary);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64728a;
  font-size: .82rem;
  font-weight: 600;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35bd85;
  box-shadow: 0 0 0 4px rgba(53, 189, 133, .12);
}

.main-content {
  max-width: 930px;
  padding-top: 68px;
  padding-bottom: 54px;
}

.hero {
  margin-bottom: 35px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 13px;
  color: var(--primary);
  border: 1px solid #d8e1f4;
  border-radius: 30px;
  background: #edf1fa;
  font-size: .78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 11px;
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -.8px;
}

.hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.converter-card {
  padding: 23px;
  border: 1px solid rgba(226, 230, 240, .9);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(29, 42, 75, .075);
}

.drop-zone {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c9d4ec;
  border-radius: 15px;
  background: linear-gradient(180deg, #f9fbff, #fff);
  cursor: pointer;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: #f3f6fd;
}

.drop-zone.drag-over {
  transform: scale(1.005);
}

.upload-icon {
  display: grid;
  width: 59px;
  height: 59px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--primary);
  border-radius: 17px;
  background: #e9eef9;
}

.upload-icon svg {
  width: 32px;
  height: 32px;
}

.drop-zone h2 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
}

.drop-zone p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.browse-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-hint {
  margin-top: 12px;
  color: #9aa3b4;
  font-size: .76rem;
}

.settings-row {
  display: flex;
  align-items: end;
  gap: 20px;
  padding: 21px 2px 3px;
}

.format-setting {
  width: 150px;
  flex-shrink: 0;
}

.settings-row label {
  display: block;
  margin-bottom: 7px;
  color: #45516a;
  font-size: .82rem;
  font-weight: 700;
}

.form-select {
  min-height: 43px;
  border-color: var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-weight: 700;
}

.form-select:focus {
  border-color: #7f97cf;
  box-shadow: 0 0 0 .2rem rgba(36, 63, 128, .14);
}

.quality-setting {
  flex: 1;
  min-width: 100px;
  padding: 0 4px;
}

.quality-setting label span {
  margin-right: 5px;
  color: var(--primary);
}

.form-range {
  margin: 8px 0 0;
  accent-color: var(--primary);
}

.convert-button {
  display: inline-flex;
  min-width: 157px;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 18px;
  color: white;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  font-weight: 700;
  transition: background .2s ease, transform .2s ease;
}

.convert-button:hover:not(:disabled) {
  color: white;
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.convert-button:disabled {
  color: #fff;
  background: #9cabcd;
  cursor: not-allowed;
}

.queue-section {
  margin-top: 21px;
  padding-top: 19px;
  border-top: 1px solid #eef0f5;
}

.queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.queue-heading h2 {
  margin: 0;
  font-size: .96rem;
  font-weight: 700;
}

.file-count {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  margin-right: 5px;
  padding: 0 5px;
  place-items: center;
  color: var(--primary);
  border-radius: 20px;
  background: #edf1fa;
  font-size: .73rem;
}

.clear-button,
.remove-button {
  padding: 4px 8px;
  color: #808ba0;
  border: 0;
  background: none;
  font-size: .78rem;
}

.clear-button:hover,
.remove-button:hover {
  color: #d34b60;
}

button:focus-visible,
.download-link:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.clear-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.file-list {
  display: grid;
  gap: 9px;
}

.file-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #edf0f5;
  border-radius: 11px;
  background: #fff;
}

.file-preview {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: cover;
  border-radius: 8px;
  background: #f0f2f7;
}

.file-info {
  min-width: 0;
  flex: 1;
}

.file-name {
  overflow: hidden;
  color: #34415a;
  font-size: .82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-detail {
  margin-top: 2px;
  color: #929caf;
  font-size: .72rem;
}

.file-status {
  flex: 0 0 auto;
  color: #929caf;
  font-size: .74rem;
}

.file-status.success {
  color: #23996a;
}

.file-status.error {
  color: #cc4658;
}

.download-link {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: var(--primary);
  border-radius: 7px;
  background: #edf1fa;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover {
  color: white;
  background: var(--primary);
}

.message-area {
  margin-top: 16px;
  padding: 10px 13px;
  color: #895b13;
  border: 1px solid #f6e5bb;
  border-radius: 9px;
  background: #fff9e9;
  font-size: .81rem;
}

.message-area.error-message {
  color: #a23645;
  border-color: #f3d0d5;
  background: #fff4f5;
}

.message-area.success-message {
  color: #17704d;
  border-color: #c4e9d8;
  background: #f0fbf6;
}

.how-it-works {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 43px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.step-number {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  color: var(--primary);
  border-radius: 12px;
  background: #e9eef9;
  font-size: .95rem;
  font-weight: 700;
}

.step-item h3 {
  margin: 0 0 1px;
  font-size: .82rem;
  font-weight: 700;
}

.step-item p {
  margin: 0;
  color: #8b96a8;
  font-size: .7rem;
}

.step-connector {
  width: 34px;
  border-top: 1px dashed #ccd1df;
}

.support-note {
  max-width: 650px;
  margin: 27px auto 0;
  color: #929caf;
  font-size: .74rem;
  text-align: center;
}

.site-footer {
  padding: 19px 0;
  color: #8993a5;
  border-top: 1px solid rgba(226, 230, 240, .8);
  font-size: .76rem;
  text-align: center;
}

@media (max-width: 575.98px) {
  .navbar {
    min-height: 65px;
  }

  .privacy-note {
    gap: 6px;
    font-size: .68rem;
  }

  .main-content {
    padding-top: 44px;
    padding-bottom: 35px;
  }

  .hero {
    margin-bottom: 25px;
  }

  .hero p {
    font-size: .88rem;
  }

  .converter-card {
    padding: 13px;
    border-radius: 15px;
  }

  .drop-zone {
    min-height: 220px;
    padding: 16px 8px;
  }

  .drop-zone h2 {
    font-size: 1rem;
  }

  .drop-zone p {
    font-size: .81rem;
  }

  .settings-row {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 12px;
    padding-top: 17px;
  }

  .format-setting {
    width: auto;
  }

  .quality-setting {
    padding: 0;
  }

  .settings-row label {
    font-size: .75rem;
  }

  .convert-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .file-item {
    gap: 8px;
    padding: 8px;
  }

  .file-preview {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }

  .file-item {
    flex-wrap: wrap;
  }

  .file-status {
    order: 1;
    flex-basis: 100%;
  }

  .download-link {
    padding: 6px 8px;
    font-size: .7rem;
  }

  .how-it-works {
    align-items: flex-start;
    gap: 9px;
    margin-top: 30px;
  }

  .step-item {
    flex: 1;
    align-items: flex-start;
    gap: 7px;
  }

  .step-number {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    border-radius: 9px;
    font-size: .8rem;
  }

  .step-item h3 {
    font-size: .71rem;
  }

  .step-item p {
    font-size: .62rem;
    line-height: 1.6;
  }

  .step-connector {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drop-zone,
  .convert-button {
    transition: none;
  }
}

.form-range::-webkit-slider-thumb,
.form-range::-webkit-slider-thumb:active {
  background-color: var(--accent);
}

.form-range::-moz-range-thumb,
.form-range::-moz-range-thumb:active {
  background-color: var(--accent);
}
