:root {
  --bg: #f5f2ec;
  --bg-alt: #fbfaf6;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --brand: #AE2922;
  --brand-dark: #8F1F1B;
  --brand-soft: rgba(174, 41, 34, 0.08);
  --accent-dark: #0f0f10;
  --border: #d9d4c9;
  --success: #1f6b3a;
  --success-bg: #eef5ef;
  --success-border: #c9ddd0;
  --error: #8b1a1a;
  --error-bg: #fbeaea;
  --error-border: #e7c3c3;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  --radius: 6px;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(at top left, rgba(174, 41, 34, 0.05), transparent 45%),
    radial-gradient(at bottom right, rgba(15, 15, 16, 0.035), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 15.5px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

/* --- Cabeçalho (marca) --- */
.brand {
  text-align: center;
  margin-bottom: 40px;
}

.brand .marca {
  display: block;
  margin: 0 auto 18px;
  width: 100%;
  max-width: 380px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.tagline {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding-top: 14px;
  position: relative;
}

.tagline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 1px;
  background: var(--brand);
  opacity: 0.35;
}

/* --- Card principal --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 10px;
  color: var(--brand);
}

.instructions {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 26px;
}

code {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* --- Dropzone --- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-alt);
  transition: border-color 0.15s ease, background-color 0.15s ease,
              transform 0.15s ease;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--brand);
  background: #fff;
}

.dropzone.drag {
  transform: scale(1.01);
}

.dz-icon {
  font-size: 32px;
  color: var(--brand);
  line-height: 1;
  font-weight: 600;
}

.dz-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.dz-hint {
  font-size: 13px;
  color: var(--muted);
}

/* --- Arquivo selecionado --- */
.selected {
  margin-top: 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.selected-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.selected-icon {
  color: var(--brand);
}

#selected-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-link {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.btn-link:hover { text-decoration: underline; }

/* --- Botão primário --- */
.btn-primary {
  display: inline-block;
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background-color 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn-primary:disabled {
  background: #c6bfb0;
  cursor: not-allowed;
}

/* --- Progresso --- */
.progress {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 14px;
}

.progress p { margin: 0; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(174, 41, 34, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Resultado --- */
.result {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
}

.success {
  color: var(--success);
  font-weight: 600;
  margin: 0 0 12px;
  font-size: 14.5px;
}

.result .btn-primary {
  margin-top: 4px;
  background: var(--success);
}

.result .btn-primary:hover {
  background: #144725;
}

/* --- Erro --- */
.error {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 14px;
}

/* --- Rodapé --- */
footer {
  margin-top: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* --- Responsivo --- */
@media (max-width: 540px) {
  .container { padding: 40px 16px; }
  .card { padding: 24px; }
  .brand .marca { max-width: 280px; }
  .dropzone { padding: 36px 16px; }
}
