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

:root {
    --primary: #FFD700;
    --primary-dark: #B8860B;
    --secondary: #0047AB;
    --secondary-dark: #002F7A;
    --tertiary: #FFF;
    --dark: #333333;
    --light: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Correios Mobile */
.correios-mobile-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    width: 100%;
}

/* Barra de Acessibilidade */
.access-bar {
    background: #f0f0f0;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.access-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.access-btn {
    background: none;
    border: none;
    color: #0075c4;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

/* Header Principal Mobile */
.main-mobile-header {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

/* Botão Menu (3 linhas) */
.mobile-menu-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.mobile-menu-button .line {
    width: 18px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Logo Correios */
.mobile-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 16px;
}

.logo-mobile {
    height: 32px;
    width: auto;
}

/* Botões da direita */
.mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-login,
.mobile-search {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-login:hover,
.mobile-search:hover {
    background: rgba(244, 167, 34, 0.1);
}

.mobile-login img,
.mobile-search img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Barra Amarela */
.yellow-stripe {
    background: #f4a722;
    height: 4px;
    width: 100%;
}

/* Desktop - Esconder header mobile */
@media (min-width: 769px) {
    .correios-mobile-header {
        display: none;
    }
}

/* Header Desktop */
.desktop-header {
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

@media (min-width: 769px) {
    .desktop-header {
        display: block;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .desktop-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .desktop-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 0;
    }

    .desktop-logo .logo-desktop {
        height: 40px;
        width: auto;
    }

    .desktop-nav {
        flex: 1;
        display: flex;
        justify-content: center;
        margin: 0 40px;
    }

    .nav-list {
        display: flex;
        list-style: none;
        gap: 32px;
    }

    .nav-link {
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .nav-link:hover {
        color: #0075c4;
    }

    .desktop-yellow-stripe {
        background: #f4a722;
        height: 4px;
        width: 100%;
    }
}

/* Header Correios Mobile */
.correios-mobile-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    width: 100%;
}

/* Barra de Acessibilidade */
.access-bar {
    background: #f0f0f0;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.access-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.access-btn {
    background: none;
    border: none;
    color: #0075c4;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

/* Header Principal Mobile */
.main-mobile-header {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

/* Botão Menu (3 linhas) */
.mobile-menu-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.mobile-menu-button .line {
    width: 18px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Logo Correios */
.mobile-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 16px;
}

.logo-mobile {
    height: 32px;
    width: auto;
}

/* Botões da direita */
.mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-login,
.mobile-search {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-login:hover,
.mobile-search:hover {
    background: rgba(244, 167, 34, 0.1);
}

.mobile-login img,
.mobile-search img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Barra Amarela */
.yellow-stripe {
    background: #f4a722;
    height: 4px;
    width: 100%;
}

/* Desktop - Esconder header mobile */
@media (min-width: 769px) {
    .correios-mobile-header {
        display: none;
    }
}

/* Header Desktop */
.desktop-header {
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

@media (min-width: 769px) {
    .desktop-header {
        display: block;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .desktop-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .desktop-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 0;
    }

    .desktop-logo .logo-desktop {
        height: 40px;
        width: auto;
    }

    .desktop-nav {
        flex: 1;
        display: flex;
        justify-content: center;
        margin: 0 40px;
    }

    .nav-list {
        display: flex;
        list-style: none;
        gap: 32px;
    }

    .nav-link {
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .nav-link:hover {
        color: #0075c4;
    }

    .desktop-yellow-stripe {
        background: #f4a722;
        height: 4px;
        width: 100%;
    }
}

/* Notification Popup */
.notification-popup {
    position: fixed;
    top: 20px;
    right: -300px;
    background-color: var(--primary);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 71, 171, 0.3);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    min-width: 250px;
}

.notification-popup.show {
    right: 20px;
}

.notification-popup.error {
    background-color: var(--error);
}

.notification-popup.success {
    background-color: var(--success);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Styles */
header {
    background-color: var(--light);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(8px);
}

header img {
    height: 40px;
    width: auto;
}

/* Container */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* Card Styles */
.card {
    background-color: var(--light);
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    background-color: var(--light);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(131, 27, 209, 0.1);
}

.form-input:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
    min-height: 44px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--light);
    box-shadow: 0 2px 8px rgba(0, 71, 171, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary);
    color: var(--light);
}

.btn-full {
    width: 100%;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-primary {
    background-color: var(--primary);
    color: var(--light);
}

/* Timer Styles */
.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--error);
}

/* QR Code Container */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background-color: var(--gray-50);
    border-radius: 12px;
    border: 2px dashed var(--gray-300);
}

.qr-code {
    padding: 16px;
    background-color: var(--light);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.qr-code:hover {
    transform: scale(1.02);
}

.qr-code img,
.qr-code svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* PIX Code Input */
.pix-code-container {
    position: relative;
    width: 100%;
}

.pix-code-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    color: var(--gray-700);
    outline: none;
    resize: none;
}

.copy-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.copy-button:hover {
    background-color: rgba(0, 71, 171, 0.1);
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
    margin: 16px 0;
}

.alert-warning {
    background-color: #FEF3C7;
    border-color: var(--warning);
    color: #92400E;
}

.alert-info {
    background-color: #DBEAFE;
    border-color: var(--info);
    color: #1E40AF;
}

.alert-success {
    background-color: #D1FAE5;
    border-color: var(--success);
    color: #065F46;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-pending .status-dot {
    background-color: var(--warning);
    animation: pulse 2s infinite;
}

.status-confirmed .status-dot {
    background-color: var(--success);
}

.status-expired .status-dot {
    background-color: var(--error);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

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

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

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Loading Animation */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Page Styles */
.success-icon {
    width: 64px;
    height: 64px;
    background-color: #D1FAE5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--success);
}

/* Value Display */
.value-display {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--light);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 16px 0;
}

.value-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.value-amount {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }
    
    .notification-popup {
        right: -280px;
        min-width: 260px;
    }
    
    .notification-popup.show {
        right: 12px;
    }
    
    .card {
        margin: 0 0 20px;
        border-radius: 12px;
    }
    
    .value-amount {
        font-size: 28px;
    }
    
    .btn {
        min-height: 48px;
        font-size: 16px;
    }
    
    .form-input {
        min-height: 48px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .qr-code {
        max-width: 240px;
    }
    
    .value-amount {
        font-size: 24px;
    }
    
    .pix-code-input {
        font-size: 12px;
        padding-right: 44px;
    }
}

/* Print Styles */
@media print {
    .notification-popup,
    .loading-overlay,
    header {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #5A0F8A;
        --gray-200: #A0A0A0;
        --gray-300: #808080;
    }
    
    .form-input {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
        border-style: solid;
        border-color: currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: var(--primary);
    }
}

/* Focus Visible for Better Accessibility */
.btn:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Utility Classes */
.hidden { display: none !important; }
.sr-only { 
    position: absolute; 
    width: 1px; 
    height: 1px; 
    padding: 0; 
    margin: -1px; 
    overflow: hidden; 
    clip: rect(0, 0, 0, 0); 
    white-space: nowrap; 
    border: 0; 
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
