:root {
  --primary: #005b96;
  --secondary: #007bff;
  --success: #28a745;
  --bg: #f5f7fa;
  --text: #222;
}

/* Base */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  text-align: center;
}

main {
  margin: 50px 15px;
}

/* Botones */
button {
  background: var(--secondary);
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s;
}
button:hover {
  background: #0056b3;
}

/* Formularios */
form {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 460px;
  width: 100%;
  transition: all 0.3s ease;
}

/* Dropzones */
.dropzone {
  position: relative;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  background: #f9fbff;
  padding: 40px 20px;
  margin: 0 auto 25px;
  transition: all 0.3s ease-in-out;
  text-align: center;
  min-height: 140px;
}
.dropzone:hover { background: #eef5ff; }
.dropzone.dragover { border-color: var(--secondary); background: #e9f1ff; }
.dropzone.loaded { border-color: var(--success); background: #e7f9ee; }

.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2; /* capta el clic */
}

.dz-content {
  position: relative;
  z-index: 1;
  pointer-events: none; /* no bloquea el clic del input */
}

/* Icono principal */
.dz-icon {
  width: 50px;
  height: 50px;
  color: var(--primary);
  opacity: 0.85;
  margin-bottom: 6px;
  transition: all 0.3s ease;
}
.dropzone.loaded .dz-icon {
  color: var(--success);
  opacity: 1;
  transform: scale(1.1);
}

/* Check de confirmación */
.check {
  display: none;
  font-size: 2rem;
  color: var(--success);
  margin-bottom: 4px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}
.dropzone.loaded .check {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* Texto inferior de estado */
#droptext {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.3s ease;
}
.dropzone.loaded #droptext {
  color: var(--success);
}

/* Nombre del archivo cargado */
.file-name {
  margin-top: 8px;
  font-size: 0.9em;
  color: #555;
  font-style: italic;
  display: none;
}
.dropzone.loaded .file-name {
  display: block;
  animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Overlay de carga */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  color: var(--primary);
  font-size: 1.2em;
}
.spinner {
  border: 4px solid #e0e0e0;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.byline {
  font-size: 0.9em;
  color: #666;
  margin-top: 6px;
  margin-bottom: 25px;
}
.byline a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.byline a:hover {
  text-decoration: underline;
}
