/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #EBF3FF; /* Azul clarinho */
    min-height: 100vh;
}

/* Container responsivo - tela completa no desktop, sem bordas no mobile */
.main-container {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Desktop: container centralizado com largura máxima */
@media (min-width: 1024px) {
    .main-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }
}

/* Tablet: padding reduzido */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-container {
        padding: 1rem;
    }
}

/* Mobile: sem padding, tela completa */
@media (max-width: 767px) {
    .main-container {
        padding: 0;
    }
    
    /* Remover bordas e margens em mobile */
    .checkout-card, .payment-card {
        border-radius: 0 !important;
        margin: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    /* Grid responsivo para mobile */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .order-summary {
        border-left: none !important;
        border-top: 1px solid #e5e7eb;
        border-radius: 0 !important;
    }
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Custom styles */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Input focus styles */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.2);
    border-color: #00C853;
    outline: none;
}

/* Button hover effect */
.pix-button {
    transition: all 0.2s ease;
    width: 100%;
}

.pix-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2);
}

/* Mobile: botões ocupam largura total */
@media (max-width: 767px) {
    .pix-button {
        padding: 1rem;
        font-size: 1.1rem;
        border-radius: 0;
    }
}

/* QR Code container styles - responsivo */
.qr-container {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 
        8px 8px 16px #e6e6e6,
        -8px -8px 16px #ffffff;
    padding: 1rem;
    border-radius: 1rem;
}

@media (max-width: 767px) {
    .qr-container {
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* QR Code responsivo */
#qrcode canvas,
#qrcode img {
    max-width: 100% !important;
    height: auto !important;
    width: 256px;
    max-width: 256px;
}

@media (max-width: 767px) {
    #qrcode canvas,
    #qrcode img {
        width: 200px !important;
        height: 200px !important;
        max-width: 200px !important;
    }
}

/* Security badge animation */
.security-badge {
    transition: all 0.3s ease;
}

.security-badge:hover {
    transform: scale(1.05);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #00C853;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #009624;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid rgba(0, 200, 83, 0.1);
    border-radius: 50%;
    border-top: 3px solid #00C853;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Copy button transition */
.copy-button {
    transition: all 0.2s ease;
    width: 100%;
}

.copy-button:hover {
    background-color: #009624;
}

.copy-button.copied {
    background-color: #00C853;
}

/* Mobile: botão de copiar maior */
@media (max-width: 767px) {
    .copy-button {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Status badge styles */
.status-badge {
    transition: all 0.3s ease;
}

.status-badge.pending {
    background-color: #FFF8E1;
    border-color: #FFE082;
    color: #FF8F00;
}

.status-badge.success {
    background-color: #E8F5E9;
    border-color: #A5D6A7;
    color: #2E7D32;
}

/* PIX icon pulse animation */
.pix-icon {
    animation: pulse 2s infinite;
}

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

/* Form validation styles */
.input-error {
    border-color: #DC2626;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Inputs responsivos */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        padding: 1rem !important;
        font-size: 16px !important; /* Evita zoom no iOS */
        border-radius: 0.5rem;
    }
}

/* Texto responsivo */
@media (max-width: 767px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
}

/* Container de código PIX responsivo */
.pix-code-container {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 767px) {
    .pix-code-container textarea {
        font-size: 12px;
        padding: 0.75rem;
        min-height: 80px;
    }
}

/* Espaçamento responsivo */
@media (max-width: 767px) {
    .space-y-8 > * + * {
        margin-top: 1rem !important;
    }
    
    .space-y-6 > * + * {
        margin-top: 0.75rem !important;
    }
    
    .space-y-4 > * + * {
        margin-top: 0.5rem !important;
    }
}

/* Padding responsivo para cards */
@media (max-width: 767px) {
    .p-8 {
        padding: 1rem !important;
    }
    
    .p-6 {
        padding: 0.75rem !important;
    }
    
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Logo responsiva */
.logo-container img {
    transition: all 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

@media (max-width: 767px) {
    .logo-container img {
        height: 2.5rem !important; /* h-10 equivalente */
        max-width: 150px !important;
    }
}

@media (min-width: 768px) {
    .logo-container img {
        height: 3.5rem !important; /* h-14 equivalente */
        max-width: 200px !important;
    }
}

/* Viewport meta tag fix para mobile */
@media (max-width: 767px) {
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}

/* Melhorias para touch devices */
@media (hover: none) and (pointer: coarse) {
    .pix-button:hover {
        transform: none;
        box-shadow: none;
    }
    
    .copy-button:hover {
        background-color: #00C853;
    }
}

/* Garantir que não há scroll horizontal */
.overflow-x-hidden {
    overflow-x: hidden;
}

/* Container principal sem scroll horizontal */
.main-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}
