/* ========================================
   ESTILOS BASE Y LAYOUT
   ======================================== */

/* Container unificado para todas las páginas de autenticación */
.container {
    min-height: calc(100vh - 20vh); /* Safe Zone para móviles */
}

.form-container {
    min-height: auto;
    transition: all 0.3s ease-in-out;
}

.form-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Optimización para evitar desplazamiento innecesario */
body {
    overflow-x: hidden;
}


/* ========================================
   ANIMACIONES GENERALES
   ======================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* ========================================
   MODALES A PANTALLA COMPLETA
   ======================================== */

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.fullscreen-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.fullscreen-modal.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.modal-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.modal-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.modal-icon.pulse {
    animation: pulse 2s infinite;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.modal-message {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.modal-btn-primary {
    background: #3b82f6;
    color: white;
}

.modal-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: #ef4444;
    color: white;
}

.modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ========================================
   ESTADOS DE CARGA MEJORADOS
   ======================================== */

.redirect-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========================================
   MENSAJES DE ÉXITO PARA REGISTRO
   ======================================== */

.success-container {
    text-align: center;
    padding: 2rem;
}

.success-animation {
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    animation: successPulse 2s infinite;
}

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

/* ========================================
   VALIDACIÓN DE URL EN TIEMPO REAL
   ======================================== */

.url-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.url-status .fas {
    width: 16px;
    text-align: center;
}

.url-status.success {
    color: #059669;
}

.url-status.error {
    color: #dc2626;
}

.url-status.loading {
    color: #3b82f6;
}

/* ========================================
   RESPONSIVE PARA MODALES
   ======================================== */

@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}


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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================
   CAMPOS DE CONTRASEÑA
   ======================================== */

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 70%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
}

.password-toggle:hover {
    color: #4b5563;
}

/* ========================================
   SEPARADORES Y DIVISORES
   ======================================== */

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before, 
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider span {
    padding: 0 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   BOTONES DE GOOGLE
   ======================================== */

.google-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.google-wrapper {
    width: 300px;
}

/* ========================================
   BOTONES Y FORMULARIOS
   ======================================== */

.login-button {
    position: relative;
    overflow: hidden;
}

.login-button::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;
}

.login-button:hover::before {
    left: 100%;
}

/* Mejoras para los campos de entrada */
input:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease-in-out;
}

/* ========================================
   OVERLAY DE REDIRECCIÓN
   ======================================== */

.redirect-overlay {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* ========================================
   ESTILOS PARA REGISTRO - ANIMACIONES DE ÉXITO
   ======================================== */

.success-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-in-out;
}

.success-container.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Animación del checkmark simplificada */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(74, 222, 128, 0.3);
    animation: successBounce 0.6s ease-out;
}

.success-icon i {
    font-size: 32px;
    color: white;
    animation: checkmarkAppear 0.4s ease-out 0.2s both;
}

/* Spinner de carga */
.loading-spinner {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4ade80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========================================
   ANIMACIONES PARA REGISTRO
   ======================================== */

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

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

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

/* ========================================
   MODALES A PANTALLA COMPLETA
   ======================================== */

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.fullscreen-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease-in-out;
}

.fullscreen-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.modal-icon.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
}

.modal-icon.success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
}

.modal-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

.modal-message {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.modal-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

/* Animación de pulso para el icono */
.modal-icon.pulse {
    animation: pulse 2s infinite;
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 640px) {
    .modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-message {
        font-size: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ESTILOS PARA SETUP-COMERCIO
   ======================================== */

/* Estilos específicos para la configuración del comercio */
.setup-container {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background: #3b82f6;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background: #3b82f6;
    color: white;
}

.step.completed .step-circle {
    background: #10b981;
    color: white;
}

.step.completed .step-circle::before {
    content: '✓';
    font-size: 16px;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.step.active .step-label {
    color: #3b82f6;
    font-weight: 600;
}

.url-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-family: monospace;
    color: #6b7280;
}

.url-preview.valid {
    border-color: #10b981;
    background: #f0fdf4;
    color: #059669;
}

.url-preview.invalid {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.welcome-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.demo-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.form-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    color: #3b82f6;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 24px;
}

/* Toast Styles */
.toast {
    position: relative;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #10B981;
    color: white;
}

.toast.error {
    background-color: #EF4444;
    color: white;
}

.toast.warning {
    background-color: #F59E0B;
    color: white;
}

.toast.info {
    background-color: #3B82F6;
    color: white;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    opacity: 0.9;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}
