/**
 * Modal de Autenticación - ChicoLandia V5
 */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(15, 23, 42, 0.75);
}

.auth-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 28px;
    padding: 28px 36px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow: visible;
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(226, 232, 240, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

.auth-modal-content.flipping {
    transform: rotateY(90deg);
    opacity: 0;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(248, 113, 113, 0.12);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(248, 113, 113, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    color: #f87171;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.15);
}

.auth-modal-close:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.25);
}

.auth-modal-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.auth-modal-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(241, 245, 249, 0.6);
    padding: 4px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.auth-tab.active {
    background: white;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-modal-message {
    text-align: center;
    color: #64748b;
    margin-bottom: 20px;
    font-size: 12px;
    line-height: 1.4;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form-group label {
    font-weight: 600;
    color: #334155;
    font-size: 12px;
    letter-spacing: 0.1px;
    margin-bottom: 0;
}

.auth-form-group input,
.auth-form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    background: rgba(248, 250, 252, 0.5);
    font-weight: 500;
    color: #0f172a;
}

.auth-form-group input:focus,
.auth-form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
    transform: scale(1.01);
}

.auth-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.auth-form-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.auth-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    font-weight: 600;
    letter-spacing: 0.2px;
    border: none;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.auth-btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.auth-modal-footer {
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    line-height: 1.3;
}

.auth-form-group small {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

.auth-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.auth-btn-secondary:hover {
    background: #e5e7eb;
}

.auth-success-message {
    text-align: center;
    padding: 30px;
}

.auth-success-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: scaleUp 0.5s ease;
}

.auth-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 10px;
}

.auth-success-text {
    color: #6b7280;
    margin-bottom: 20px;
}

.auth-loading {
    text-align: center;
    padding: 20px;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 0.8s linear infinite;
}

.auth-loading-text {
    color: #6b7280;
    font-size: 15px;
}

.auth-error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.auth-info-message {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 15px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .auth-modal-content {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .auth-modal-title {
        font-size: 24px;
    }

    .auth-modal-icon {
        font-size: 48px;
    }

    .auth-form-group input,
    .auth-form-group textarea {
        padding: 10px 14px;
        font-size: 14px;
    }

    .auth-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}
