/* MP3 Audio Convertor — dark, clean, mobile-first design.
   Palette: deep navy/slate surfaces, one bright accent (electric teal).
   (Design language shared with PhotoKB.) */

:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: #131f38;
  --surface-2: #182747;
  --border: #24365c;
  --text: #e8eefb;
  --muted: #9db0d0;
  --accent: #14e0c8;
  --accent-dark: #0bb39e;
  --accent-ink: #04241f;
  --danger: #ff7a7a;
  --radius: 16px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(11, 18, 32, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(8px);
}
.header-in { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: var(--accent-ink);
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}
.main-nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 12px; }
.hero h1 .hl { color: var(--accent); }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 8px; font-size: 1.05rem; }
.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.badge {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; font-weight: 600;
}
.badge strong { color: var(--accent); }

.page-head { padding: 32px 0 4px; }
.page-head h1 { font-size: 1.8rem; line-height: 1.25; margin: 0 0 10px; }
.page-head .lede { color: var(--muted); max-width: 720px; margin: 0; }

/* ---------- Tool shell ---------- */
.tool-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 22px 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #10233f; }
.dz-icon { font-size: 2rem; }
.dz-title { font-size: 1.05rem; font-weight: 700; margin: 8px 0 4px; }
.dz-sub { color: var(--muted); font-size: 0.88rem; margin: 0; }

.tool-controls {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin-top: 16px;
}
.tool-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.tool-controls input[type="number"],
.tool-controls input[type="text"],
.tool-controls select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; font-size: 0.95rem; min-width: 110px;
}
.tool-controls input[type="color"] { width: 52px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); padding: 2px; }
.tool-controls input[type="range"] { accent-color: var(--accent); width: 150px; }
.check-label { flex-direction: row !important; align-items: center; gap: 8px !important; padding-bottom: 10px; }
.check-label input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 12px;
  padding: 12px 22px; font-size: 1rem; font-weight: 800; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-chip {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 13px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-chip:hover, .btn-chip.active { border-color: var(--accent); color: var(--accent); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-row .chip-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-right: 2px; }

.preset-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20, 224, 200, 0.12); border: 1px solid var(--accent);
  color: var(--accent); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.9rem;
}
.tool-note { color: var(--accent); font-size: 0.92rem; margin: 12px 0 0; }

.results { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.result-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.result-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.result-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 0.9rem; }
.result-meta span { color: var(--muted); }
.result-meta .result-label { color: var(--accent); font-weight: 600; }
.result-meta .result-note { color: var(--muted); font-size: 0.82rem; }
.btn-download {
  background: var(--accent); color: var(--accent-ink) !important;
  border-radius: 10px; padding: 10px 16px; font-weight: 800; flex: none;
}
.btn-download:hover { text-decoration: none; background: var(--accent-dark); }

/* ---------- Cropper ---------- */
.crop-mount { margin-top: 16px; }
.pkb-cropper { width: 100%; }
.pkb-crop-stage { position: relative; margin: 0 auto; max-width: 100%; touch-action: none; }
.pkb-crop-img { display: block; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.pkb-crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(4, 10, 20, 0.55);
  cursor: move; touch-action: none;
}
.pkb-crop-handle {
  position: absolute; right: -12px; bottom: -12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 3px solid #06231e;
  cursor: nwse-resize;
}
.pkb-face-guide { position: absolute; inset: 0; pointer-events: none; }
.pkb-face-oval {
  position: absolute; left: 50%; top: 12%;
  width: 52%; height: 52%;
  transform: translateX(-50%);
  border: 2px dashed rgba(20, 224, 200, 0.75);
  border-radius: 50%;
}
.pkb-face-line {
  position: absolute; left: 8%; right: 8%; top: 74%;
  border-top: 2px dashed rgba(20, 224, 200, 0.5);
}
.crop-info { color: var(--muted); font-size: 0.9rem; }

/* ---------- Tool grid / cards ---------- */
.section-title { font-size: 1.4rem; margin: 34px 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; color: var(--text);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.tool-card .tc-icon { font-size: 1.6rem; }
.tool-card .tc-name { font-weight: 800; font-size: 1.02rem; }
.tool-card .tc-desc { color: var(--muted); font-size: 0.88rem; }

/* ---------- Content sections ---------- */
.content { max-width: 780px; }
.content h2 { font-size: 1.3rem; margin: 30px 0 8px; }
.content h3 { font-size: 1.08rem; margin: 22px 0 6px; }
.content p, .content li { color: #c6d3ee; }
.content ul, .content ol { padding-left: 22px; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px 12px 48px; margin: 10px 0; position: relative;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 13px; top: 11px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px; margin: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { color: var(--muted); margin: 8px 0 2px; }
.related { margin: 26px 0 6px; }
.related h2 { font-size: 1.2rem; margin-bottom: 10px; }

/* ---------- Ads ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: 12px;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.78rem; letter-spacing: 1.5px; text-transform: uppercase;
  margin: 18px 0; background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.ad-slot[data-loaded] { border: none; min-height: 0; background: transparent; }

.consent-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 100;
  background: var(--surface-2); border: 1px solid var(--accent);
  border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  max-width: 860px; margin: 0 auto;
}
.consent-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; color: var(--text); }
.consent-actions { display: flex; gap: 8px; }
.btn-consent-accept { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 9px; padding: 9px 16px; font-weight: 800; cursor: pointer; }
.btn-consent-decline { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 9px; padding: 9px 16px; font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; background: var(--bg-2); }
.footer-in { padding-top: 26px; padding-bottom: 30px; display: flex; flex-direction: column; gap: 14px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.footer-note { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- Converter ---------- */
.file-info {
  margin-top: 12px; font-size: 0.95rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.file-info span { color: var(--muted); }
.progress-wrap { margin-top: 16px; }
.progress-track {
  height: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 999px; transition: width 0.2s ease;
}
.progress-text { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }
.result-icon {
  width: 64px; height: 64px; border-radius: 8px; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.55rem; }
  .page-head h1 { font-size: 1.45rem; }
  .result-card { flex-wrap: wrap; }
  .tool-controls { flex-direction: column; align-items: stretch; }
  .tool-controls input[type="range"] { width: 100%; }
  .header-in { flex-direction: column; align-items: flex-start; gap: 8px; }
  .main-nav { margin-left: 0; }
}
