:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --text: #22252a;
  --muted: #6b7078;
  --border: #e6e3df;
  --accent: #ea7a2b;
  --accent-soft: #fdf1e7;
  --accent-dark: #c45f17;
  --ok: #2f9e5b;
  --err: #c93c3c;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(20, 20, 20, .06);
  --shadow-hover: 0 14px 28px rgba(234, 122, 43, .18), 0 4px 10px rgba(20, 20, 20, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; }
.brand strong { color: var(--accent-dark); }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 16px; flex: 1; }

.hero { text-align: center; margin: 16px 0 36px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0; }
.accent { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, border-color .2s;
}
.tool:hover, .tool:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: #f3c7a5;
  outline: none;
}
.tool-title { font-weight: 600; font-size: 1.08rem; }
.tool-desc { color: var(--muted); font-size: .9rem; line-height: 1.4; }

.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; }

/* ---------- Páginas de herramienta ---------- */
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 16px; }
.back:hover { color: var(--accent-dark); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.card > p { color: var(--muted); margin: 0 0 20px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 2px dashed #e9c9b0;
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.dropzone.over { border-color: var(--accent); background: #fbe4d2; }
.dropzone strong { color: var(--accent-dark); }
.dropzone input { display: none; }
.dropzone small { color: var(--muted); }

.status { margin: 16px 0 0; color: var(--muted); font-size: .95rem; min-height: 1.4em; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }

.progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 12px; display: none; }
.progress.show { display: block; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(234, 122, 43, .25); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover:not(:disabled) { background: var(--bg); box-shadow: none; }

.errors { margin-top: 16px; font-size: .88rem; color: var(--err); padding-left: 18px; }
.hidden { display: none; }
