@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { 
    font-family: 'Inter', sans-serif; 
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Page transition styles */
.page {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.page.active {
    display: block;
    opacity: 1;
}

/* Glass effect styles */
.glass-surface {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Gradient backgrounds */
.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pattern-bg {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.25) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* Input error state */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Animation classes */
.slide-animation {
    animation: slideInUp 0.8s ease-out;
}

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

.float-element {
    animation: floatUp 4s ease-in-out infinite;
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Shadow effects */
.shadow-glow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

/* Spinner styles */
.spinner-element {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, #3b82f6, transparent);
    animation: rotateSpinner 1.2s linear infinite;
    position: relative;
    margin: 0 auto 2rem auto;
}

.spinner-element::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    background: white;
    border-radius: 50%;
}

.spinner-element::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
}

@keyframes rotateSpinner {
    to { transform: rotate(360deg); }
}

/* Text animations */
.text-pulse {
    animation: textPulseAnimation 2s ease-in-out infinite;
}

@keyframes textPulseAnimation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.text-fade {
    animation: textFadeInOut 3s ease-in-out infinite;
}

@keyframes textFadeInOut {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.text-loading {
    animation: textLoadingFade 3s ease-in-out infinite;
}

@keyframes textLoadingFade {
    0%, 100% { opacity: 1; }
    33% { opacity: 0.7; }
    66% { opacity: 0.4; }
}

/* Dot animation */
.dot-animation {
    animation: dotSequence 1.5s infinite;
}

@keyframes dotSequence {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.dot-animation::after {
    content: '';
    animation: dotSequence 1.5s infinite;
}

/* Success alert styles */
.success-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    color: #333;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid #10b981;
    animation: slideDownFromTop 0.4s ease-out;
    z-index: 10000;
    min-width: 280px;
}

.success-alert .timer-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.success-alert .timer-bar {
    width: 100%;
    height: 100%;
    background-color: #10b981;
    animation: timerCountdown 5s linear forwards;
}

@keyframes slideDownFromTop {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

@keyframes timerCountdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* Rotation animation */
.rotate-animation {
    animation: rotate 1s linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Blink animation */
.blink-indicator {
    animation: blinkDot 2s infinite;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* QR wrapper styles */
.qr-wrapper {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.qr-wrapper:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

/* PIX code selection */
#pixCode {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Time display */
.time-display {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Document frame */
.document-frame {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    position: relative;
}

.document-frame::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.1;
}

.doc-shadow {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Field labels */
.field-label {
    transform: translateY(-6px);
    font-size: 0.65rem;
    color: #6b7280;
}

/* Beat animation */
.beat-animation {
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Danger gradient */
.danger-gradient {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

/* Caution gradient */
.caution-gradient {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

/* Transaction gradient */
.transaction-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Process gradient */
.process-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Loading gradient */
.loading-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Paper background */
.paper-background {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Amount highlight */
.amount-highlight {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Alert modal */
.alert-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alert-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Transaction Progress Animation */
.transaction-progress {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.transaction-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    border-radius: 20px;
    animation: transactionProgress 5s ease-in-out;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

@keyframes transactionProgress {
    0% { width: 0%; }
    25% { width: 30%; }
    50% { width: 60%; }
    75% { width: 85%; }
    100% { width: 100%; }
}

/* Progress Bar */
.progress-wrapper {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
    border-radius: 10px;
    animation: progressFill 5s ease-in-out;
    transform-origin: left;
}

@keyframes progressFill {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* Security Badges */
.security-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin: 0 8px;
}

.security-badge > *:not(:last-child) {
    margin-right: 8px;
}

/* Process Cards */
.process-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.process-card.current {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
}

/* Process Steps */
.process-step {
    opacity: 0.6;
    transition: all 0.8s ease;
}

.process-step.current {
    opacity: 1;
    transform: scale(1.02);
}

.process-step.done {
    opacity: 1;
}

/* Glow Effect */
.glow-effect {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: glowMovement 2s infinite;
}

@keyframes glowMovement {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Print styles */
@media print {
    body * { 
        display: none !important; 
    }
    body::after { 
        content: "Você não tem permissão para imprimir esta página. Obrigado.";
        display: block !important;
        text-align: center;
        font-size: 20px;
        margin-top: 50px;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .success-alert {
        width: 90%;
        min-width: unset;
    }
    
    .spinner-element {
        width: 50px;
        height: 50px;
    }
    
    .spinner-element::before {
        top: 4px;
        left: 4px;
        right: 4px;
        bottom: 4px;
    }
    
    .spinner-element::after {
        width: 16px;
        height: 16px;
    }
}