@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  /* Botón Principal de Acción (Hero / CTA) - CREDICOOPE Rebranding */
  .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background-color: #5B961C;
    color: #ffffff;
    font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 9999px;
    border: 1.5px solid transparent;
    box-shadow: 0 4px 12px rgba(91, 150, 28, 0.25);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-action:hover {
    background-color: #4e8217;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 150, 28, 0.35);
  }

  /* Botón Secundario (Hero / CTA) - CREDICOOPE Rebranding */
  .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background-color: #ffffff;
    color: #004119;
    font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 9999px;
    border: 1.5px solid #004119;
    box-shadow: 0 2px 8px rgba(0, 65, 25, 0.08);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-secondary:hover {
    background-color: #004119;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 65, 25, 0.2);
  }

  /* Botón de Navegación Header (Hazte socio) - Homologado */
  .btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: #5B961C;
    color: #ffffff;
    font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(91, 150, 28, 0.2);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-nav:hover {
    background-color: #4e8217;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 150, 28, 0.3);
  }

  /* Botón Tarjeta (Acción Secundaria) */
  .btn-card {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: #ffffff;
    transition: all 0.2s ease;
    text-decoration: none;
  }

  .btn-card:hover {
    opacity: 0.9;
    transform: translateX(3px);
  }
}

@layer utilities {
  /* Explicit Corporate Palette Utilities */
  .bg-\[\#004119\] { background-color: #004119 !important; }
  .bg-\[\#5B961C\] { background-color: #5B961C !important; }
  .bg-\[\#012447\] { background-color: #012447 !important; }
  .bg-\[\#D7150B\] { background-color: #D7150B !important; }
  .bg-\[\#F9A503\] { background-color: #F9A503 !important; }
  .bg-\[\#FFFFFF\] { background-color: #FFFFFF !important; }
}

/* Local Corporate Font Family - MONTSERRAT (REBRANDING 2027-2050) */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-800.ttf') format('truetype');
}

html, body, button, input, select, textarea, .font-heading, .font-sans {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif !important;
}

/* Custom Reset and Utilities for CREDICOOPE Theme */
.container-credicoope {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-credicoope {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-credicoope {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Custom Buttons & Badges */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background-color: #004119;
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 65, 25, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #002d11;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(0, 65, 25, 0.3);
}

.badge-sbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background-color: rgba(34, 197, 94, 0.12);
  color: #15803D;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Regla Defensiva Infalible de Dimensionamiento de Isotipo / Logotipo */
.site-logo img, header img, img.site-logo-img {
  max-height: 48px !important;
  max-width: 220px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Regla Defensiva de Especificidad para Menú Desktop Institucional */
@media (min-width: 1024px) {
  nav.site-main-nav {
    display: flex !important;
  }
}

/* Barra de Navegación Móvil Fija de 5 Accesos Directos (Estilo App) */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 64px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
  .mobile-bottom-bar {
    display: none !important;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  width: 20%;
  height: 100%;
  transition: color 0.15s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: #004119;
}

/* Smart Header Global Transition & Hiding Rule */
.site-header {
  transition: transform 300ms ease-in-out !important;
  will-change: transform;
}

.site-header.header-hidden {
  transform: translateY(-100%) !important;
}

/* ==========================================================================
   SIMULADOR METÁLICO V2 CREDICOOPE - PRECISIÓN, TECNOLOGÍA & FINANZAS
   ========================================================================== */

/* Panel Contenedor Metálico Principal */
.sim-metallic-section {
  background: linear-gradient(135deg, #011933 0%, #012447 50%, #002d12 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.6);
}

/* Selector Metálico Premium */
.sim-metallic-select {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
  border: 2px solid #004119 !important;
  box-shadow: 0 4px 14px rgba(0, 65, 25, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transition: all 0.2s ease-in-out !important;
}

.sim-metallic-select:hover, .sim-metallic-select:focus {
  border-color: #5B961C !important;
  box-shadow: 0 6px 20px rgba(91, 150, 28, 0.25), inset 0 1px 0 #ffffff !important;
}

/* Ficha Contextual Metálica (Columna Izquierda) */
.sim-metallic-ficha {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 25px rgba(1, 36, 71, 0.08), inset 0 1px 1px #ffffff !important;
}

/* Consola Metálica de Simulación (Columna Derecha) */
.sim-metallic-consola {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 12px 35px rgba(0, 65, 25, 0.12), inset 0 1px 1px #ffffff !important;
}

/* Sliders Metálicos de Presición */
input[type="range"].sim-range-metallic {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(180deg, #cbd5e1 0%, #e2e8f0 100%) !important;
  border-radius: 9999px !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  outline: none !important;
}

input[type="range"].sim-range-metallic::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 60%, #5B961C 100%) !important;
  border: 2.5px solid #004119 !important;
  box-shadow: 0 3px 8px rgba(0, 65, 25, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

input[type="range"].sim-range-metallic::-webkit-slider-thumb:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 4px 14px rgba(91, 150, 28, 0.5), 0 0 10px rgba(91, 150, 28, 0.4), inset 0 1px 1px #ffffff !important;
}

input[type="range"].sim-range-metallic::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 60%, #5B961C 100%) !important;
  border: 2.5px solid #004119 !important;
  box-shadow: 0 3px 8px rgba(0, 65, 25, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* Tarjeta Protagonista Resultante de Cuota (Tratamiento Metálico de Precisión) */
.sim-metallic-hero-result {
  background: linear-gradient(135deg, #002b11 0%, #004119 50%, #012447 100%) !important;
  border: 1.5px solid #5B961C !important;
  box-shadow: 
    0 16px 36px rgba(0, 65, 25, 0.4),
    0 0 25px rgba(91, 150, 28, 0.22),
    inset 0 1px 2px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.5) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Botón CTA Metálico Premium */
.btn-cta-metallic {
  background: linear-gradient(135deg, #6bb820 0%, #5B961C 50%, #467615 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 
    0 6px 20px rgba(91, 150, 28, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-cta-metallic:hover {
  background: linear-gradient(135deg, #74c723 0%, #63a41e 50%, #4d8217 100%) !important;
  box-shadow: 
    0 8px 25px rgba(91, 150, 28, 0.48),
    0 0 16px rgba(91, 150, 28, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.65) !important;
  transform: translateY(-2px) !important;
}


