/**
 * ========================================
 * CORREIOS - PÁGINA DE SUCESSO
 * Design profissional com identidade Correios
 * Versão: 2.0.0
 * ========================================
 */

/* ========================================
   RESET E VARIÁVEIS
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --azul-correios: #004169;
    --azul-escuro: #00314f;
    --azul-claro: #0071ad;
    --amarelo-correios: #FFC40C;
    --verde-sucesso: #16a34a;
    --verde-escuro: #15803d;
    --verde-claro: #22c55e;
    --cinza-claro: #f5f5f5;
    --cinza-medio: #e5e7eb;
    --cinza-texto: #6b7280;
    --branco: #ffffff;
    --texto: #1f2937;
    --text-letter-spacing: -0.03em;
    
    --sombra-leve: 0 2px 8px rgba(0, 0, 0, 0.08);
    --sombra-media: 0 4px 16px rgba(0, 0, 0, 0.12);
    --sombra-forte: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    --raio-pequeno: 8px;
    --raio-medio: 12px;
    --raio-grande: 16px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', Arial, sans-serif;
    line-height: 1.5;
    letter-spacing: var(--text-letter-spacing);
    background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 50%, #f8fafc 100%);
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    letter-spacing: inherit;
}

.fa,
.fas,
.far,
.fal,
.fab,
[class^="fa-"],
[class*=" fa-"],
i,
svg,
.icon,
[class*="-icon"],
code,
pre,
kbd,
samp,
.codigo-rastreio,
.resumo-rastreio-valor,
#resumoCpf,
.resumo-total-valor,
.valor-numero,
.timer-valor,
.timer-banner .timer-valor,
.timer-content .timer-valor,
.copiacola-input,
.lote-codigo,
.preco-valor,
.info-value,
.status-id,
.input-cpf {
    letter-spacing: normal;
}

/* ========================================
   HEADER
======================================== */
.header {
    background: var(--cinza-claro);
    border-bottom: 3px solid var(--amarelo-correios);
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 1rem;
    position: relative;
    height: 40px;
}

.header-nav.has-user-name {
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-correios {
    height: 25px;
    width: auto;
}

.btn-entrar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0 0 0.75rem;
    color: var(--azul-correios);
    border-left: 1px solid #ccc;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.header-nav.has-user-name .btn-entrar {
    display: flex;
}

.btn-entrar .icon-entrar {
    width: auto;
    height: 20px;
}

.btn-entrar .user-name {
    white-space: nowrap;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    font-weight: 600;
}

@media (min-width: 768px) {
    .header-nav {
        justify-content: center;
    }
    
    .header-nav.has-user-name {
        justify-content: center;
    }
    
    .btn-entrar {
        position: absolute;
        right: 1rem;
        padding: 0 0 0 1rem;
    }
    
    .header-nav.has-user-name .btn-entrar {
        display: flex;
    }
    
    .btn-entrar .icon-entrar {
        height: 25px;
    }
    
    .btn-entrar .user-name {
        height: 25px;
        line-height: 25px;
        font-size: 16px;
    }
}

.logo-correios-legacy {
    height: 28px;
    width: auto;
}

.header-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--verde-sucesso) 0%, var(--verde-claro) 50%, var(--amarelo-correios) 100%);
}

/* ========================================
   MAIN
======================================== */
.main {
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    width: 100%;
}

/* ========================================
   BANNER DE SUCESSO
======================================== */
.success-banner {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.success-confetti {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, var(--amarelo-correios) 2px, transparent 2px),
        radial-gradient(circle at 80% 20%, var(--verde-claro) 2px, transparent 2px),
        radial-gradient(circle at 40% 80%, var(--azul-claro) 2px, transparent 2px),
        radial-gradient(circle at 90% 70%, var(--amarelo-correios) 1.5px, transparent 1.5px),
        radial-gradient(circle at 10% 60%, var(--verde-sucesso) 1.5px, transparent 1.5px);
    opacity: 0.4;
    animation: confetti-float 3s ease-in-out infinite;
}

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

.success-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.25rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--verde-sucesso) 0%, var(--verde-escuro) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35);
    animation: icon-bounce 0.6s ease-out;
}

@keyframes icon-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon i {
    font-size: 2.5rem;
    color: var(--branco);
}

.success-ring {
    position: absolute;
    inset: -8px;
    border: 3px solid var(--verde-claro);
    border-radius: 50%;
    opacity: 0.5;
    animation: ring-pulse 2s ease-out infinite;
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--verde-sucesso);
    margin-bottom: 0.375rem;
    animation: fade-up 0.5s ease-out 0.2s both;
}

.success-subtitle {
    font-size: 1rem;
    color: var(--cinza-texto);
    animation: fade-up 0.5s ease-out 0.3s both;
}

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

/* ========================================
   WRAPPER PRINCIPAL
======================================== */
.success-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   CARD DE STATUS
======================================== */
.status-card {
    background: var(--branco);
    border-radius: var(--raio-grande);
    box-shadow: var(--sombra-media);
    overflow: hidden;
}

.status-header {
    background: linear-gradient(135deg, var(--verde-sucesso) 0%, var(--verde-escuro) 100%);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--branco);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-badge i {
    font-size: 1rem;
}

.status-id {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* Timeline */
.status-timeline {
    padding: 1.25rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--cinza-medio);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item.completed::before {
    background: var(--verde-sucesso);
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

.timeline-item.completed .timeline-dot {
    background: var(--verde-sucesso);
    color: var(--branco);
}

.timeline-item.active .timeline-dot {
    background: var(--azul-claro);
    color: var(--branco);
    animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 113, 173, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 113, 173, 0); }
}

.timeline-item.pending .timeline-dot {
    background: var(--cinza-medio);
    color: var(--cinza-texto);
}

.timeline-content {
    flex: 1;
    padding-top: 0.25rem;
}

.timeline-content strong {
    display: block;
    font-size: 0.875rem;
    color: var(--texto);
    margin-bottom: 0.125rem;
}

.timeline-content span {
    font-size: 0.75rem;
    color: var(--cinza-texto);
}

/* ========================================
   GRID DE INFORMAÇÕES
======================================== */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.info-card {
    background: var(--branco);
    border-radius: var(--raio-medio);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--sombra-leve);
    border: 1px solid var(--cinza-medio);
}

.info-card.rastreio {
    border-color: var(--azul-claro);
    background: linear-gradient(135deg, #eff6ff 0%, var(--branco) 100%);
}

.info-card.previsao {
    border-color: var(--verde-sucesso);
    background: linear-gradient(135deg, #f0fdf4 0%, var(--branco) 100%);
}

.info-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.info-card.rastreio .info-icon {
    background: linear-gradient(135deg, var(--azul-correios) 0%, var(--azul-claro) 100%);
    color: var(--branco);
}

.info-card.previsao .info-icon {
    background: linear-gradient(135deg, var(--verde-sucesso) 0%, var(--verde-claro) 100%);
    color: var(--branco);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--cinza-texto);
    margin-bottom: 0.25rem;
}

.info-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--texto);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.info-card.previsao .info-value {
    font-family: inherit;
    font-size: 0.9375rem;
}

.btn-copy-small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--cinza-medio);
    background: var(--branco);
    color: var(--azul-claro);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy-small:hover {
    background: var(--azul-claro);
    color: var(--branco);
    border-color: var(--azul-claro);
}

/* ========================================
   PRÓXIMOS PASSOS
======================================== */
.next-steps {
    background: var(--branco);
    border-radius: var(--raio-grande);
    padding: 1.25rem;
    box-shadow: var(--sombra-leve);
}

.next-steps h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--azul-correios);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.next-steps h3 i {
    font-size: 1rem;
    color: var(--azul-claro);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--cinza-claro);
    border-radius: var(--raio-pequeno);
    transition: all 0.2s ease;
}

.step-card:hover {
    background: #e8f4f8;
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--azul-correios) 0%, var(--azul-claro) 100%);
    color: var(--branco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-info {
    flex: 1;
}

.step-info strong {
    display: block;
    font-size: 0.875rem;
    color: var(--texto);
    margin-bottom: 0.25rem;
}

.step-info p {
    font-size: 0.75rem;
    color: var(--cinza-texto);
    line-height: 1.4;
}

/* ========================================
   RECIBO
======================================== */
.receipt-card {
    background: var(--branco);
    border-radius: var(--raio-grande);
    box-shadow: var(--sombra-leve);
    overflow: hidden;
    border: 1px solid var(--cinza-medio);
}

.receipt-header {
    background: var(--cinza-claro);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--texto);
    border-bottom: 1px dashed var(--cinza-medio);
}

.receipt-header i {
    color: var(--azul-claro);
}

.receipt-body {
    padding: 1rem 1.25rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.receipt-row span {
    font-size: 0.8125rem;
    color: var(--cinza-texto);
}

.receipt-row strong {
    font-size: 0.875rem;
    color: var(--texto);
    text-align: right;
}

.receipt-row .valor-destaque {
    color: var(--verde-sucesso);
    font-size: 1rem;
}

.receipt-footer {
    padding: 1rem 1.25rem;
    background: var(--cinza-claro);
    border-top: 1px dashed var(--cinza-medio);
}

.btn-print {
    width: 100%;
    padding: 0.75rem;
    background: var(--branco);
    border: 1px solid var(--cinza-medio);
    border-radius: var(--raio-pequeno);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--texto);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-print:hover {
    background: var(--azul-correios);
    color: var(--branco);
    border-color: var(--azul-correios);
}

.btn-print i {
    font-size: 1rem;
}

/* ========================================
   SEGURANÇA FOOTER
======================================== */
.security-footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--cinza-texto);
}

.security-item i {
    font-size: 0.875rem;
    color: var(--verde-sucesso);
}

/* ========================================
   FOOTER
======================================== */
.footer {
    background: url('../images/rodape-mobile.svg') center/cover no-repeat;
    color: #1e3a5f;
    padding: 1.5rem 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
}

.footer-logos img {
    height: 2rem;
    width: auto;
}

.footer-logos .logo-footer {
    height: 5.5rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.footer-copyright {
    text-align: center;
    font-size: 0.7rem;
    color: #014268;
    margin-bottom: 0;
    font-weight: 500;
    padding-bottom: 1rem;
    line-height: 1.4;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
}

.footer-links {
    display: none;
}

.footer-section h4 {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section ul li i {
    width: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-section ul li:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .footer {
        background: url('../images/rodape-mobile.svg') center/cover no-repeat;
        padding: 2rem 1rem;
        color: var(--azul-correios);
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(1, 66, 104, 0.2);
    }

    .footer-logos .logo-footer {
        height: 4rem;
    }

    .footer-logos {
        margin-bottom: 0.75rem;
    }

    .footer-copyright {
        color: var(--azul-correios);
        font-weight: 400;
        margin-bottom: 0;
        padding-bottom: 0;
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .footer-section h4 {
        color: var(--azul-correios);
    }

    .footer-section ul li {
        color: var(--azul-correios);
    }
}

/* ========================================
   TOAST
======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--texto);
    color: var(--branco);
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--sombra-forte);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    color: var(--verde-claro);
}

/* ========================================
   RESPONSIVO - DESKTOP
======================================== */
@media (min-width: 640px) {
    .main {
        padding: 0 1rem 3rem;
    }
    
    .success-banner {
        padding: 2.5rem 1rem 2rem;
    }
    
    .success-icon {
        width: 100px;
        height: 100px;
    }
    
    .success-icon i {
        font-size: 3rem;
    }
    
    .success-title {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .header,
    .footer,
    .btn-print,
    .btn-copy-small,
    .success-confetti,
    .success-ring,
    .toast,
    .security-footer {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .main {
        max-width: 100%;
        padding: 0;
    }
    
    .success-banner {
        padding: 1rem;
    }
    
    .success-wrapper {
        gap: 0.5rem;
    }
    
    .status-card,
    .info-card,
    .next-steps,
    .receipt-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
