/* ==========================================
   ESTILOS GENERALES Y VARIABLES (CSS3 VANILLA)
   ========================================== */
:root {
  --primary-color: #1e3a8a;       /* Azul Institucional */
  --primary-hover: #1e40af;
  --secondary-color: #475569;     /* Gris Slate */
  --secondary-hover: #334155;
  --success-color: #15803d;       /* Verde Éxito */
  --success-bg: #f0fdf4;
  --whatsapp-color: #25d366;      /* Verde WhatsApp */
  --whatsapp-hover: #1da851;
  --error-color: #dc2626;         /* Rojo Error */
  --error-bg: #fef2f2;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #cbd5e1;
  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 1.5rem 1rem;
}

.app-container {
  max-width: 680px;
  margin: 0 auto;
}

/* ==========================================
   ENCABEZADO
   ========================================== */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.75rem;
  color: var(--primary-color);
  font-weight: 700;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================
   TARJETAS Y CONTENEDORES
   ========================================== */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.instruction {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================
   FORMULARIO E INPUTS
   ========================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.required {
  color: var(--error-color);
}

.form-control,
.file-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus,
.file-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

select.form-control {
  cursor: pointer;
}

.help-text {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* ==========================================
   ALERTAS Y BANNERS
   ========================================== */
.status-banner {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.status-banner.error {
  background-color: var(--error-bg);
  color: var(--error-color);
  border: 1px solid #fca5a5;
}

.status-banner.success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border: 1px solid #86efac;
}

.hidden {
  display: none !important;
}

/* ==========================================
   BOTONES Y ACCIONES
   ========================================== */
.form-actions {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-whatsapp {
  background-color: var(--whatsapp-color);
  color: #ffffff;
  font-size: 1.05rem;
}

.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   PANEL DE CONFIRMACIÓN
   ========================================== */
.success-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.success-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.success-header h2 {
  color: var(--success-color);
  font-size: 1.4rem;
}

.summary-box {
  background-color: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.summary-box h3 {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.summary-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 0.3rem;
}

.summary-item dt {
  font-weight: 600;
  color: var(--text-secondary);
}

.summary-item dd {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.wa-action-box {
  text-align: center;
  margin-bottom: 1.5rem;
}

.wa-instruction {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.restart-box {
  margin-top: 1rem;
}

/* ==========================================
   PIE DE PÁGINA
   ========================================== */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2rem;
}

/* Media Queries para Responsividad */
@media (min-width: 480px) {
  body {
    padding: 2.5rem 1rem;
  }
}
