/**
 * IntegroLend Landing Page - Custom Styles
 * Complementary styles for Tailwind CSS
 * Optimized for performance and accessibility
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  --color-brand-dark: #0b1220;
  --color-brand-surface: #0f172a;
  --color-brand-primary: #3b82f6;
  --color-brand-primary-hover: #2563eb;
  --color-brand-accent: #22c55e;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --transition-base: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Styles & Reset
   ============================================ */

/* Smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Background gradient with radial overlays */
body {
  background: 
    radial-gradient(1200px 600px at 80% -10%, rgba(30, 41, 59, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(14, 165, 233, 0.35), transparent 60%),
    var(--color-brand-dark);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Remove default focus outline and add custom one */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   Skip Link (Accessibility)
   ============================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1.5rem;
  background: var(--color-brand-primary);
  color: white;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid white;
}

/* ============================================
   Button Components
   ============================================ */

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(180deg, var(--color-brand-primary), var(--color-brand-primary-hover));
  border: 1px solid #1d4ed8;
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 9999px;
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.2);
  border-color: #475569;
  color: white;
}

.btn-secondary:active {
  background: rgba(51, 65, 85, 0.3);
}

/* ============================================
   Card Component
   ============================================ */
.card {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.8), rgba(11, 18, 32, 0.7));
  border: 1px solid #1f2937;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

/* Benefit Card Variant */
.benefit-card {
  background: var(--color-brand-surface);
  border: 1px solid #253047;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all var(--transition-base);
  text-align: center;
}

.benefit-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-brand-accent);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   Form Components
   ============================================ */

/* Form Input Base Style */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  transition: all var(--transition-base);
}

.form-input::placeholder {
  color: #64748b;
}

.form-input:hover {
  border-color: #475569;
}

.form-input:focus {
  border-color: var(--color-brand-primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input with validation error */
.form-input.error {
  border-color: #ef4444;
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Input with validation success */
.form-input.success {
  border-color: var(--color-brand-accent);
}

/* Form Error Message */
.form-error {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: #ef4444;
}

/* Form Success Message */
.form-success {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-brand-accent);
}

/* ============================================
   Animations
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Pulse Animation for Loading States */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Container with max-width constraint */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Hidden utility (for screen readers) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Mobile optimizations */
@media (max-width: 640px) {
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  
  .card {
    padding: 1.25rem;
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .skip-link,
  header,
  footer,
  #contacto {
    display: none;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Force hardware acceleration for animations */
.btn-primary,
.btn-secondary,
.card,
.benefit-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Optimize image rendering */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   Dark Mode Support (Future Enhancement)
   ============================================ */
@media (prefers-color-scheme: light) {
  /* Currently designed for dark mode only */
  /* Light mode styles can be added here in future versions */
}