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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 16px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    gap: 8px;
}

.logo i {
    font-size: 1.8rem;
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 2px;
    font-weight: 500;
}

/* Main */
.main {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

/* Tracking Form */
.tracking-form {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.tracking-form h1 {
    color: #1e3c72;
    margin-bottom: 8px;
    font-size: 1.6rem;
    font-weight: 700;
}

.tracking-form p {
    color: #666;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 1px;
}

.input-group input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    font-weight: 500;
}

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

.example-codes {
    margin-top: 16px;
}

.example-codes p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #888;
}

.code-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.code-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* Tracking Result */
.tracking-result {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.package-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.status-posted {
    background: rgba(40, 167, 69, 0.25);
}

.status-retained {
    background: rgba(255, 193, 7, 0.25);
    animation: pulse 2s infinite;
}

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

.tracking-code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Urgent Alert */
.urgent-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 5px solid #ffc107;
    padding: 20px;
    margin: 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.alert-icon {
    color: #856404;
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.alert-content h3 {
    color: #856404;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.alert-content p {
    color: #856404;
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.price-highlight {
    color: #dc3545 !important;
    font-weight: 700 !important;
    font-size: 1.1em;
}

.benefit {
    font-weight: 600 !important;
}

/* Conversion Section */
.conversion-section {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-weight: 500;
}

.benefit-item i {
    color: #28a745;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Payment Section */
.payment-section {
    padding: 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.payment-highlight {
    margin-bottom: 20px;
}

.payment-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #28a745;
    margin-bottom: 4px;
}

.payment-description {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-pix-main {
    background: linear-gradient(135deg, #32BCAD 0%, #00D4AA 100%);
    color: white;
    border: none;
    padding: 20px 32px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(50, 188, 173, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 280px;
}

.btn-pix-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(50, 188, 173, 0.5);
}

.btn-pix-main:active {
    transform: translateY(-1px);
}

.btn-pix-main i {
    font-size: 1.5rem;
}

.btn-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: none;
    letter-spacing: normal;
}

.guarantee-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.guarantee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.guarantee-item i {
    font-size: 1rem;
}

/* Package Info */
.package-info {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.value {
    font-weight: 600;
    font-size: 0.9rem;
}

.highlight {
    color: #28a745;
    font-weight: 700;
}

/* Progress Bar */
.progress-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.progress-section h3 {
    margin-bottom: 16px;
    color: #1e3c72;
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    transition: width 0.8s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.progress-labels .active {
    color: #28a745;
    font-weight: 600;
}

/* Timer Section */
.timer-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.timer-box {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.3);
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.timer-label {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 500;
}

.timer-display {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.timer-warning {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.95;
}

/* Timeline */
.timeline {
    padding: 20px;
}

.timeline h3 {
    margin-bottom: 20px;
    color: #1e3c72;
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 45px;
    width: 2px;
    height: calc(100% + 4px);
    background: #e9ecef;
}

.timeline-item.active::after {
    background: #28a745;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-item.active .timeline-icon {
    background: #28a745;
    color: white;
}

.timeline-content {
    flex: 1;
    padding-top: 4px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.timeline-location {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.timeline-date {
    color: #999;
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 500;
}

/* Actions */
.actions {
    padding: 20px;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 24px;
}

.pix-info {
    text-align: center;
    margin-bottom: 24px;
}

.pix-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: #28a745;
    margin-bottom: 4px;
}

.pix-description {
    color: #666;
    font-weight: 500;
}

.pix-qr-section {
    text-align: center;
    margin-bottom: 24px;
}

.qr-container {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    display: inline-block;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.qr-container img {
    max-width: 200px;
    height: auto;
    display: block;
}

.pix-qr-section p {
    font-weight: 500;
    color: #666;
}

.pix-code-section {
    margin-bottom: 24px;
}

.pix-code-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.code-container {
    display: flex;
    gap: 8px;
}

.code-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    background: #f8f9fa;
}

.btn-copy {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-copy:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pix-instructions {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.pix-instructions h4 {
    margin-bottom: 8px;
    color: #1e3c72;
    font-weight: 600;
}

.pix-instructions ol {
    margin-left: 20px;
}

.pix-instructions li {
    margin-bottom: 4px;
    color: #666;
    font-weight: 500;
}

.payment-guarantee {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Footer */
.footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 16px 0;
    margin-top: auto;
}

.footer p {
    font-size: 0.85rem;
    opacity: 0.9;
}

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

@keyframes slideIn {
    from { 
        transform: translateY(-50px) scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .main {
        padding: 16px 0;
    }
    
    .tracking-form {
        padding: 20px;
        margin: 0 8px;
    }
    
    .tracking-result {
        margin: 0 8px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-primary {
        justify-content: center;
        padding: 16px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 0;
    }
    
    .timer-display {
        font-size: 1.8rem;
    }
    
    .payment-price {
        font-size: 2rem;
    }
    
    .btn-pix-main {
        min-width: auto;
        width: 100%;
        padding: 18px 24px;
        font-size: 1.1rem;
    }
    
    .benefits-list {
        gap: 8px;
    }
    
    .benefit-item {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .guarantee-badges {
        flex-direction: column;
        gap: 8px;
    }
    
    .guarantee-item {
        justify-content: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .code-container {
        flex-direction: column;
    }
    
    .progress-labels {
        font-size: 0.7rem;
    }
    
    .urgent-alert {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .alert-icon {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .tracking-form {
        padding: 16px;
    }
    
    .package-header {
        padding: 16px;
    }
    
    .status-badge {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .tracking-code {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .timeline-item {
        gap: 12px;
    }
    
    .timeline-icon {
        width: 36px;
        height: 36px;
    }
    
    .timer-display {
        font-size: 1.6rem;
    }
    
    .pix-amount {
        font-size: 1.8rem;
    }
    
    .qr-container img {
        max-width: 180px;
    }
    
    .alert-content h3 {
        font-size: 1rem;
    }
    
    .payment-price {
        font-size: 1.8rem;
    }
}

/* Melhorias para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Melhorias para telas de alta densidade */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .qr-container img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}