/* Variables CSS compartidas */
:root {
    --primary: #0d1b2a;
    --secondary: #415a77;
    --accent: #e0b1cb;
    --accent-hover: #c497b2;
    --blue-grey: #778da9;
    --dark-text: #1b263b;
    --bg-light: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6b7280;
    --border-light: #dee2e6;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gradient-primary: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%);
    --gradient-accent: linear-gradient(135deg, #e0b1cb 0%, #c497b2 100%);
    --shadow-soft: 0 4px 20px rgba(13, 27, 42, 0.08);
    --shadow-medium: 0 8px 32px rgba(13, 27, 42, 0.12);
    --shadow-strong: 0 16px 48px rgba(13, 27, 42, 0.16);
}

/* Reset y estilos base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Estados de carga */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--gradient-primary);
    color: white;
    flex-direction: column;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    display: inline-block;
}

.loading-spinner.large {
    width: 50px;
    height: 50px;
    border-width: 4px;
    margin: 0 0 20px 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de partículas flotantes */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.4; }
    50% { transform: translateY(-15px) rotate(180deg); opacity: 0.7; }
}

/* Botones reutilizables */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--gradient-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    background: #a0aec0;
    transform: none;
}

.btn.secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn.small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn.large {
    padding: 20px 32px;
    font-size: 1.1rem;
}

/* Mensajes */
.message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: var(--success);
    border: 1px solid #9ae6b4;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
    color: var(--error);
    border: 1px solid #f5c6cb;
}

.warning-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: var(--warning);
    border: 1px solid #ffdf7e;
}

.info-message {
    background: linear-gradient(135deg, #e2f3ff 0%, #b8e7ff 100%);
    color: var(--info);
    border: 1px solid #a3d9ff;
}

/* Formularios */
.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-text);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224, 177, 203, 0.1);
    transform: translateY(-1px);
}

.form-group input.valid {
    border-color: var(--success);
}

.form-group input.invalid {
    border-color: var(--error);
}

.validation-message {
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
}

.validation-message.success {
    color: var(--success);
}

.validation-message.error {
    color: var(--error);
}

/* Tarjetas */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(13, 27, 42, 0.05);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.card.centered {
    text-align: center;
    max-width: 450px;
    margin: 0 auto;
}

/* Enlaces */
.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Estados de error */
.error-container {
    text-align: center;
    padding: 50px;
    color: var(--error);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-slide-up {
    animation: slideInUp 0.8s ease-out;
}

.animate-stagger {
    animation: staggerIn 1s ease-out 0.3s both;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsividad */
@media (max-width: 768px) {
    .card {
        padding: 25px 20px;
        margin: 10px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 14px 16px;
    }
}

/* Estados de foco para accesibilidad */
.btn:focus,
.form-group input:focus,
.form-group textarea:focus,
.link:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
