/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Asegurar que el modal esté oculto por defecto - Prioridad máxima */
#modalSoporte {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#modalSoporte.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #10b981;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --border-color: rgba(99, 102, 241, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

/* Fondo animado */
.bg-3d-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-3d-login .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite;
    box-shadow: 0 0 10px var(--primary-color);
}

.bg-3d-login .particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 15s; }
.bg-3d-login .particle:nth-child(2) { left: 30%; animation-delay: 2s; animation-duration: 18s; }
.bg-3d-login .particle:nth-child(3) { left: 50%; animation-delay: 4s; animation-duration: 20s; }
.bg-3d-login .particle:nth-child(4) { left: 70%; animation-delay: 1s; animation-duration: 16s; }
.bg-3d-login .particle:nth-child(5) { left: 90%; animation-delay: 3s; animation-duration: 19s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Container principal */
.login-container {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 1;
}

/* Panel izquierdo */
.login-left {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left-content {
    width: 100%;
    max-width: 500px;
    z-index: 2;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 3rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-light);
}

.login-brand {
    margin-bottom: 3rem;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.logo-icon-large {
    font-size: 4rem;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

.login-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.login-features {
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.login-visual {
    position: relative;
    height: 300px;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.float-card {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.float-card.card-1 {
    top: 10%;
    left: 10%;
    animation: float-card 6s ease-in-out infinite;
}

.float-card.card-2 {
    top: 50%;
    right: 10%;
    animation: float-card 8s ease-in-out infinite 1s;
}

.float-card.card-3 {
    bottom: 10%;
    left: 20%;
    animation: float-card 7s ease-in-out infinite 2s;
}

@keyframes float-card {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.login-3d-element {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    perspective: 1000px;
}

.cube-login {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-cube 20s infinite linear;
}

.cube-login .face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--gradient-1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.cube-login .face.front { transform: rotateY(0deg) translateZ(60px); }
.cube-login .face.back { transform: rotateY(180deg) translateZ(60px); }
.cube-login .face.right { transform: rotateY(90deg) translateZ(60px); }
.cube-login .face.left { transform: rotateY(-90deg) translateZ(60px); }
.cube-login .face.top { transform: rotateX(90deg) translateZ(60px); }
.cube-login .face.bottom { transform: rotateX(-90deg) translateZ(60px); }

@keyframes rotate-cube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Panel derecho */
.login-right {
    background: rgba(2, 6, 23, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-box {
    width: 100%;
    max-width: 450px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    animation: slideDown 0.3s ease;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert svg {
    flex-shrink: 0;
}

/* Formulario */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group label svg {
    color: var(--primary-light);
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(15, 23, 42, 0.7);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(15, 23, 42, 0.7);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Checkbox personalizado */
.checkbox-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    border-color: var(--primary-light);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border-color);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }
    50% {
        transform: rotate(45deg) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.9);
    transform: scale(1.05);
}

.checkbox-label:active .checkbox-custom {
    transform: scale(0.95);
}

.checkbox-text {
    flex: 1;
    color: var(--text-primary);
    font-weight: 400;
}

.checkbox-text a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 0 2px;
    border-radius: 3px;
}

.checkbox-text a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.checkbox-text a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.checkbox-text a:hover::after {
    width: calc(100% - 4px);
}

/* Botón */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.info-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Footer del login */
.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
    }
    
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 2rem;
    }
    
    .login-box {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.75rem;
    }
    
    .checkbox-group {
        padding: 0.875rem;
    }
    
    .checkbox-label {
        font-size: 0.875rem;
        gap: 0.75rem;
    }
    
    .checkbox-custom {
        width: 20px;
        height: 20px;
        margin-top: 2px;
    }
    
    .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
        left: 6px;
        top: 2px;
        width: 4px;
        height: 8px;
        border-width: 0 2px 2px 0;
    }
    
    .checkbox-text a {
        word-break: break-word;
        display: inline-block;
    }
}

/* Estilos específicos para WhatsApp en páginas de login/registro - Prioridad alta */
body.login-body .whatsapp-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    border: none;
    animation: pulse-whatsapp 2s infinite;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.login-body .whatsapp-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.login-body .whatsapp-float-button:active {
    transform: scale(0.95);
}

.login-body .whatsapp-float-button svg {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}

body.login-body .modal-soporte {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 10000 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.login-body .modal-soporte.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

body.login-body .modal-soporte-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

body.login-body .modal-soporte-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

body.login-body .modal-soporte-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.login-body .modal-soporte-header .whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: #25D366;
}

body.login-body .modal-soporte-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

body.login-body .modal-soporte-close:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}

body.login-body .modal-soporte-body {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

body.login-body .modal-soporte-body p {
    margin-bottom: 15px;
}

body.login-body .modal-soporte-body strong {
    color: var(--text-primary);
}

body.login-body .modal-soporte-button {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

body.login-body .modal-soporte-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

body.login-body .modal-soporte-button:active {
    transform: translateY(0);
}

body.login-body .modal-soporte-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 768px) {
    body.login-body .whatsapp-float-button {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
        z-index: 10001; /* Asegurar que esté por encima del overlay en móviles */
    }
    
    body.login-body .whatsapp-float-button svg {
        width: 28px;
        height: 28px;
    }
}
