/**
 * Estilos del Modal de Autenticación
 * Login y Registro de usuarios
 */

.auth-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2147483647 !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.2s ease;
    isolation: isolate !important;
}

.auth-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
    z-index: 2147483646 !important;
}

.auth-modal-content {
    position: relative !important;
    background: white !important;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex !important;
    z-index: 2147483647 !important;
}

/* Split layout para desktop */
@media (min-width: 769px) {
    .auth-modal-content {
        min-height: 550px;
    }
}

.auth-modal-left {
    flex: 1;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%);
    padding: 48px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white !important;
    position: relative;
    overflow: hidden;
}

/* Cuando tiene imagen de fondo */
.auth-modal-left.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-modal-left.has-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(37, 99, 235, 0.5) 50%, rgba(30, 64, 175, 0.5) 100%);
    z-index: 0;
}

@media (min-width: 769px) {
    .auth-modal-left {
        display: flex;
    }
}

.auth-modal-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.auth-modal-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.auth-modal-left h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 16px;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
    text-stroke: 1px rgba(255, 255, 255, 0.8);
    paint-order: stroke fill;
}

.auth-modal-left p {
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.6;
    margin: 0 0 32px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-modal-left-icon {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.9;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

.auth-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    z-index: 10;
}

.auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-modal-header {
    padding: 40px 32px 24px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    .auth-modal-header {
        padding: 32px 24px 20px;
    }
}

.auth-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

@media (max-width: 768px) {
    .auth-modal-header h2 {
        font-size: 24px;
        margin: 0 0 6px;
    }
}

.auth-modal-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.auth-modal-body {
    padding: 32px;
}

@media (max-width: 768px) {
    .auth-modal-body {
        padding: 24px;
    }
}

/* Formularios */
.auth-form {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Avatar Upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-preview i {
    font-size: 36px;
    color: #adb5bd;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload {
    background: white !important;
    border: 2px dashed #3b82f6 !important;
    color: #3b82f6 !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-upload:hover {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}

.btn-upload i {
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group-checkbox input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-group-checkbox label {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4) !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.link-button {
    background: none;
    border: none;
    color: #3b82f6 !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-family: inherit;
}

.link-button:hover {
    text-decoration: underline;
    color: #2563eb !important;
}

.link {
    color: #3b82f6 !important;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
    color: #2563eb !important;
}

/* Toggle */
.auth-toggle {
    text-align: center;
    padding: 16px 0;
}

.auth-toggle p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    position: relative;
    background: white;
    padding: 0 16px;
    font-size: 13px;
    color: #999;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-social:hover {
    border-color: #ccc;
    background: #f9f9f9;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* Notificaciones */
.auth-notification {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.auth-notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
        max-width: 440px;
    }

    .form-group input {
        padding: 10px 14px;
        font-size: 16px;
        /* Evita zoom en iOS */
    }

    .btn-primary {
        padding: 12px 20px;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .auth-modal-content {
        background: #1a1a1a;
        color: #fff;
    }

    .auth-modal-header {
        border-bottom-color: #333;
    }

    .auth-modal-header h2 {
        color: #fff;
    }

    .auth-modal-header p {
        color: #999;
    }

    .form-group label {
        color: #e0e0e0;
    }

    .form-group input {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }

    .form-group input:focus {
        border-color: #FF6B35;
        background: #333;
    }

    .auth-divider::before {
        background: #444;
    }

    .auth-divider span {
        background: #1a1a1a;
    }

    .btn-social {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }

    .btn-social:hover {
        background: #333;
        border-color: #555;
    }

    .auth-modal-close:hover {
        background: #2a2a2a;
        color: #fff;
    }
}