/* estilos.css — Maquetación sencilla y moderna de index.html */

:root {
  --fondo: #f4f6fb;
  --tarjeta: #ffffff;
  --texto: #1f2937;
  --suave: #6b7280;
  --borde: #e5e7eb;
  --acento: #4f46e5;
  --acento-hover: #4338ca;
  --radio: 12px;
  --sombra: 0 4px 16px rgba(15, 23, 42, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0f172a;
    --tarjeta: #1e293b;
    --texto: #e2e8f0;
    --suave: #94a3b8;
    --borde: #334155;
    --acento: #818cf8;
    --acento-hover: #a5b4fc;
    --sombra: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 1100px;
  padding: 32px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}

header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
}

header p { margin: 0 0 24px; color: var(--suave); }

/* Tarjetas */
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.tarjeta h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

/* Controles */
.controles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.controles label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.nota { margin: 12px 0 0; font-size: 0.85rem; color: var(--suave); }

input[type=number],
input[type=file] {
  font: inherit;
  color: inherit;
  padding: 8px 10px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--fondo);
}

input[type=number] { width: 100px; }

input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: var(--acento);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover:not(:disabled) { background: var(--acento-hover); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: wait; }

#info:empty, #resultado:empty { display: none; }
#info { margin: 12px 0 0; color: var(--suave); }

/* Tabla de resultados */
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--borde);
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--suave);
}

tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; }

#resultado {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--acento) 12%, transparent);
  font-weight: 600;
}

/* Imágenes */
.imagenes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.imagenes figure { margin: 0; }

.imagenes figcaption {
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--borde);
  background: var(--fondo);
}
