/* =========================================================
   Estilos personalizados - SolSySer / Sercobrint
   ========================================================= */

/* =========================================================
   Tipografía base y fondo general
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

body {
  font-family: 'Poppins', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.08rem;
  color: #1f2937;
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #f8fafc 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Títulos */
h1, h2, h3 {
  font-family: 'Poppins', 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #111827;
}

/* =========================================================
   Tarjetas (Cards)
   ========================================================= */
.card {
  position: relative;
  z-index: 0;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;

  transform: none !important;
  backface-visibility: visible !important;
  will-change: auto !important;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  filter: brightness(1.03);
  box-shadow: 0 14px 28px rgba(32, 65, 136, 0.25);
  border-color: rgba(32, 65, 136, 0.2);
}

.card * {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

.card h2 {
  font-size: 1.22rem;
  font-weight: 600;
  color: #1f2937;
  text-shadow: 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.card p {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.4;
  margin-top: 0.25rem;
  text-shadow: 0 0 0.5px rgba(0, 0, 0, 0.08);
}

/* Desactivar hover exclusivo para páginas de login */
.login-page .card:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  border-color: #e5e7eb !important;
}

/* =========================================================
   Tarjeta estática (para login u otros contenedores)
   ========================================================= */
.card-static {
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(32, 65, 136, 0.12);
  transition: box-shadow 0.3s ease;

  transform: none !important;
  will-change: auto !important;
  backface-visibility: visible !important;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.card-static:hover {
  box-shadow: 0 10px 28px rgba(32, 65, 136, 0.2);
  border-color: rgba(32, 65, 136, 0.2);
}

/* =========================================================
   Botones principales
   ========================================================= */
.btn-primary {
  background-color: #204188;
  color: #fff;
  font-family: 'Poppins';
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: #1b3670;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(32, 65, 136, 0.35);
}

.btn-primary.sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Botón secundario */
.btn-secondary {
  background-color: #6b7280;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.25s ease-in-out;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #4b5563;
  transform: scale(1.05);
}

/* Botón advertencia */
.btn-warning {
  background-color: #f59e0b;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.25s ease-in-out;
}

.btn-warning:hover {
  background-color: #d97706;
  transform: scale(1.05);
}

/* Botón pequeño */
.btn-small {
  background-color: #204188;
  color: white;
  padding: 0.35rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s ease-in-out;
}

.btn-small:hover {
  background-color: #1b3670;
  transform: scale(1.05);
}

.btn-disabled {
  background-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

/* =========================================================
   Campos de formulario
   ========================================================= */
.input-primary {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: #fff;
  color: #1f2937;
  transition: all 0.25s ease-in-out;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.input-primary::placeholder {
  color: #9ca3af;
}

.input-primary:focus {
  border-color: #204188;
  box-shadow: 0 0 0 3px rgba(32, 65, 136, 0.25);
}

/* Estilo especial solo en página login */
.login-page .input-primary {
  border-color: #e5e7eb;
  background-color: #fafbff;
}

/* =========================================================
   Mensajes flash
   ========================================================= */
.flash-message {
  animation: fadeIn 0.4s ease-in-out, fadeOutShrink 0.8s ease-in-out 3.5s forwards;
  border-radius: 0.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutShrink {
  0%   { opacity: 1; height: auto; padding: 0.75rem; }
  80%  { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 0; height: 0; padding: 0; }
}

/* =========================================================
   Grid de tarjetas
   ========================================================= */
.card {
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  justify-items: center;
  gap: 2.5rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.cards-grid .card {
  width: 300px;
  min-height: 260px;          /* Reducido (antes 340px) */
  padding: 2rem 1.5rem;       /* Más compacto */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
}

footer strong {
  color: #204188;
}
