:root {
  --bg: #0f172a;
  --bg-grad-1: #1e293b;
  --bg-grad-2: #0f172a;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --accent-docx: #2b579a;
  --accent-xlsx: #217346;
  --accent-pptx: #d24726;
  --shadow: 0 10px 40px rgba(2, 6, 23, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
  min-height: 100vh;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 24px;
}

.hero { text-align: center; color: #f8fafc; margin-bottom: 24px; }
.hero .logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto 14px;
  background: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.25);
}
.hero h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.5px; }
.hero .sub { margin: 0; opacity: 0.85; font-size: 15px; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

/* Drop zone */
.drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--muted);
}
.drop:hover, .drop.drag {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}
.drop-inner svg { color: inherit; }
.drop-title { font-weight: 600; margin-top: 10px; color: var(--text); }
.drop-hint { font-size: 13px; margin-top: 4px; }
.drop.has-file { border-style: solid; border-color: #16a34a; background: #f0fdf4; color: #166534; }

/* Format tiles */
.formats {
  border: 0;
  padding: 0;
  margin: 22px 0 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.formats legend {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  width: 100%;
}
.fmt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: #fff;
}
.fmt input:checked + .fmt-tile {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.fmt-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  display: grid; place-items: center;
  font-size: 16px;
}
.fmt-icon.docx { background: var(--accent-docx); }
.fmt-icon.xlsx { background: var(--accent-xlsx); }
.fmt-icon.pptx { background: var(--accent-pptx); }
.fmt-name { font-weight: 600; }
.fmt-ext { font-size: 12px; color: var(--muted); }

/* Options */
.opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.lang { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.lang select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

/* Button */
.btn {
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }

/* Status */
.status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}
.status.error { color: #b91c1c; }
.status.success { color: #166534; }
.status .spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; color: #94a3b8; margin-top: 22px; }
.foot a { color: #cbd5e1; text-decoration: none; border-bottom: 1px dotted #64748b; }
.foot a:hover { color: #ffffff; border-bottom-color: #cbd5e1; }
.foot strong { color: #e2e8f0; font-weight: 600; }

@media (max-width: 560px) {
  .formats { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
