/**
 * Estilos Principales - Sistema Notarial atinet v3.0
 * Complementa Tailwind CSS con estilos personalizados
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    /* Colores principales */
    --color-primary: #0284c7;
    --color-primary-dark: #0369a1;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #ea580c;
    --color-info: #0891b2;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Bordes */
    --border-radius: 0.5rem;
    --border-width: 1px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Transiciones */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* ============================================
   INPUTS Y FORMULARIOS
   ============================================ */
.input-field {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #111827;
    transition: all 0.2s ease-in-out;
}

.input-field:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.5);
}

.input-field:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.input-field.error {
    border-color: #ef4444;
}

.input-field.success {
    border-color: #22c55e;
}

/* Select personalizado */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ============================================
   TABS
   ============================================ */
.tab-button {
    border-bottom: 2px solid transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tab-button:hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

.tab-button.active {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideInRight 0.3s ease-out;
}

/* ============================================
   UTILIDADES
   ============================================ */

/* Ocultar campos según tipo de persona */
.campo-fisica {
    display: block;
}

.campo-moral {
    display: none;
}

body.persona-moral .campo-fisica {
    display: none !important;
}

body.persona-moral .campo-moral {
    display: block !important;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 4px solid #d1d5db;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile First - Pantallas pequeñas */
@media (max-width: 640px) {
    .input-field {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Focus visible para navegación por teclado */
*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.5);
}

/* Reducir movimiento para usuarios con preferencias */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
