/**
 * ========================================
 * CORREIOS - ETAPA 2 - PAGAMENTO
 * Estilos otimizados e organizados
 * Versão: 2.1.0
 * ========================================
 */

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

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

body {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', Arial, sans-serif;
    line-height: 1.5;
    letter-spacing: var(--text-letter-spacing);
    background-color: #ffffff;
    color: #003f6b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -moz-osx-font-smoothing: grayscale;
}

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;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================
   VARIÁVEIS CSS
======================================== */
:root {
    --cor-azul-escuro: #004169;
    --cor-azul: #0056b3;
    --cor-amarelo: #FFC40C;
    --cor-vermelho: #dc3545;
    --cor-verde: #28a745;
    --cor-cinza-claro: #f5f5f5;
    --cor-cinza: #6c757d;
    --cor-texto: #333;
    --cor-branco: #ffffff;
    --text-letter-spacing: -0.03em;
    
    --sombra-leve: 0 2px 4px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 4px 8px rgba(0, 0, 0, 0.15);
    
    --raio-borda: 0.5rem;
    --transicao: all 0.2s ease;
}

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

.header-top {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--cor-azul-escuro);
    border-bottom: 1px solid #ddd;
}

.header-top i {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

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

/* Mobile: quando tem nome, logo vai para esquerda */
.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(--cor-azul-escuro);
    border-left: 1px solid #ccc;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Mobile: mostra botão quando tem nome */
.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) {
    /* Desktop: logo sempre centralizada */
    .header-nav {
        justify-content: center;
    }
    
    .header-nav.has-user-name {
        justify-content: center;
    }
    
    /* Desktop: botão sempre à direita (posição absoluta) */
    .btn-entrar {
        position: absolute;
        right: 1rem;
        padding: 0 0 0 1rem;
    }
    
    /* Desktop: mostra botão quando tem nome */
    .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;
    }
}

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

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 3.5vw, 0.875rem); /* Responsivo: 12px a 14px */
    color: #003f6b;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb i {
    font-size: 0.875rem;
    color: var(--cor-cinza);
}

/* ========================================
   ALERTA PRINCIPAL
======================================== */
.alerta-principal {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff8f8 0%, #fff 100%);
    border-radius: var(--raio-borda);
    border-left: 4px solid var(--cor-vermelho);
}

.alerta-titulo {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #b91c1c;
    font-size: clamp(1rem, 5vw, 1.375rem); /* Responsivo: 16px a 22px */
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.3;
    text-transform: uppercase;
}

.alerta-titulo span {
    flex: 1;
    position: relative;
    top: -1px;
}

/* Quebra de linha só no mobile */
.mobile-only {
    display: inline;
}

.alerta-titulo i {
    display: none; /* Esconde no mobile */
    font-size: 1.25rem;
    color: #b91c1c;
    flex-shrink: 0;
    line-height: 1.3;
}

.rastreio-status-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.codigo-rastreio {
    display: block;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    color: var(--cor-azul-escuro);
    background: var(--cor-cinza-claro);
    padding: 0.4rem 0.875rem;
    border-radius: 4px;
    border: 1px solid var(--cor-amarelo);
    width: fit-content;
    margin-bottom: 0.5rem;
}

.status-pagamento {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    width: fit-content;
    margin-bottom: 0.75rem;
}

@keyframes blink-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #ffc107;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-texto {
    color: #ffc107;
    font-weight: 600;
    font-size: 1.125rem; /* 18px */
    text-transform: uppercase;
    animation: blink-status 1s step-start infinite;
}

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

.info-tributacao {
    margin-bottom: 1rem;
    border: 1px solid #dde3e9;
    border-top: 3px solid var(--cor-amarelo);
    border-radius: var(--raio-borda);
    padding: 0.75rem 0.875rem;
}

.info-tributacao p {
    margin-bottom: 0.375rem;
    line-height: 1.5;
    font-size: 0.875rem;
}

.info-tributacao p:last-child {
    margin-bottom: 0;
}

.info-tributacao p i {
    margin-right: 0.25rem;
}

/* Valor não quebra linha */
.valor-nowrap {
    white-space: nowrap;
}

/* Texto de observação institucional */
.texto-observacao {
    color: var(--cor-cinza);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.texto-observacao i {
    color: var(--cor-azul);
    margin-right: 0.25rem;
}

@media (min-width: 768px) {
    .valor-destaque {
        font-size: 1rem; /* 16px no desktop */
    }
}

/* Urgência — vermelho da paleta Correios */
.texto-urgente {
    color: var(--cor-vermelho);
    font-weight: 600;
}

/* Botão Pagar */
.btn-pagar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(to right, #0071ad, #005d8f);
    color: var(--cor-branco);
    font-weight: 700;
    font-size: clamp(0.75rem, 3.5vw, 1rem); /* Responsivo: 12px a 16px */
    padding: 1rem;
    border-radius: var(--raio-borda);
    text-align: center;
    transition: var(--transicao);
    box-shadow: var(--sombra-media);
    margin-bottom: 1.5rem;
    white-space: nowrap;
}

.btn-pagar i {
    font-size: 20px;
    height: 20px;
    line-height: 1;
    position: relative;
    top: -1px;
}

.btn-pagar:hover {
    background: linear-gradient(to right, #005d8f, #004a73);
    transform: scale(1.02);
}

/* Aviso abaixo do botão */
.aviso-botao {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
    line-height: 1.4;
}

.aviso-botao i {
    margin-right: 0.25rem;
    color: #28a745;
}

/* ========================================
   STATUS DA ENTREGA
======================================== */
.status-entrega {
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border-radius: var(--raio-borda);
    border-left: 4px solid var(--cor-azul-escuro);
}

.status-entrega-titulo {
    display: block;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    color: var(--cor-azul-escuro);
    margin-bottom: 1rem;
}

.status-entrega-titulo i {
    font-size: 1rem; /* 16px */
    color: var(--cor-azul-escuro);
    margin-right: 0.25rem;
}

.imagem-nota {
    margin-bottom: 1rem;
}

.img-nota-fiscal {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--raio-borda);
}

/* Variante Alerta - Sem fundo para visual mais limpo */
.status-entrega.alerta {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
}

.status-entrega.alerta .status-entrega-titulo {
    color: var(--cor-azul-escuro);
}

.status-entrega.alerta .status-entrega-titulo i {
    color: var(--cor-azul-escuro);
}

/* ========================================
   TIMELINE
======================================== */
.timeline {
    padding: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Linha vertical contínua */
.timeline::before {
    content: '';
    position: absolute;
    left: calc(1rem + 25px);
    top: 25px;
    bottom: 25px;
    width: 2px;
    background: var(--cor-amarelo);
}

.timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 2rem;
}

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

.timeline-line {
    display: none;
}

.timeline-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: var(--cor-cinza-claro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: 3px solid var(--cor-amarelo);
}

.timeline-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--cor-azul-escuro);
}

.timeline-icon i {
    font-size: 1.5rem;
    color: var(--cor-azul-escuro);
}

.timeline-icon .icon-correios {
    width: 32px;
    height: auto;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline-titulo {
    font-size: 0.875rem;
    font-weight: 700;
    color: #003f6b;
    margin-bottom: 0.25rem;
}

.timeline-titulo.texto-vermelho {
    color: #dc2626;
}

.timeline-descricao {
    font-size: 0.8125rem;
    color: #003f6b;
    line-height: 1.5;
}

.timeline-data {
    font-size: 0.8125rem;
    color: var(--cor-texto);
}

.timeline-link {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cor-azul-escuro);
}

.link-pagamento {
    color: var(--cor-azul);
    text-decoration: underline;
}

.link-pagamento:hover {
    color: var(--cor-azul-escuro);
}

/* ========================================
   BANNER / CARROSSEL
======================================== */
.banner-section {
    margin-bottom: 2rem;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--raio-borda);
    box-shadow: var(--sombra-leve);
}

.carousel-inner {
    position: relative;
    width: 100%;
}

.carousel-slide {
    width: 100%;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide:first-child {
    position: relative;
    visibility: visible;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile: esconder botões de navegação */
.carousel-btn {
    display: none;
}

.carousel-indicators {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.375rem;
    z-index: 10;
}

.carousel-indicator {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    border: 1px solid var(--cor-branco);
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicator.active {
    background: var(--cor-branco);
}

/* Desktop: botões aparecem no hover */
@media (min-width: 768px) {
    .carousel-btn {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9);
        border: none;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        color: var(--cor-azul-escuro);
        font-size: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 10;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .carousel:hover .carousel-btn {
        opacity: 1;
    }

    .carousel-btn:hover {
        background: var(--cor-branco);
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .carousel-btn-prev {
        left: 1rem;
    }

    .carousel-btn-next {
        right: 1rem;
    }

    .carousel-indicators {
        bottom: 0.75rem;
        gap: 0.5rem;
    }

    .carousel-indicator {
        width: 0.5rem;
        height: 0.5rem;
    }
}

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

.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;
}

/* Mobile: esconder links */
.footer-links {
    display: none;
}

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

.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;
}

/* ========================================
   LOADER
======================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cor-branco);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 1000;
    color: var(--cor-azul-escuro);
}

.loader.hidden {
    display: none;
}

/* ========================================
   RESPONSIVO - TABLET E DESKTOP
======================================== */
@media (min-width: 768px) {
    .alerta-principal {
        padding: 0.75rem 1.5rem;
        margin-bottom: 0.5rem;
    }

    .alerta-titulo {
        font-size: 1.25rem; /* 20px no desktop */
        gap: 0.75rem;
        align-items: center;
    }
    
    .alerta-titulo i {
        display: flex; /* Mostra no desktop */
        font-size: 20px;
        height: 20px;
        width: 20px;
        align-items: center;
        justify-content: center;
    }

    .alerta-titulo .mobile-only {
        display: none;
    }

    .info-tributacao {
        max-width: 500px;
    }

    .info-tributacao p {
        font-size: 1rem; /* 16px no desktop */
    }
    
    .codigo-rastreio {
        font-size: 1rem; /* 16px */
        padding: 0.25rem 1rem;
        margin-bottom: 0.25rem;
    }

    .status-pagamento {
        padding: 0.5rem 0;
    }

    .status-texto {
        font-size: 1.25rem; /* 20px no desktop */
    }
    
    .btn-pagar {
        max-width: 500px;
        margin: 0;
        font-size: 1.125rem;
    }
    
    /* Aviso abaixo do botão - Desktop */
    .aviso-botao {
        max-width: 500px;
        margin: 0;
        margin-top: 0.75rem;
        margin-bottom: 1.5rem;
        text-align: left;
        padding: 0;
    }
    
    .status-entrega-titulo {
        font-size: 1rem; /* 16px no desktop */
    }

    .status-entrega-titulo i {
        font-size: 1rem; /* 16px no desktop */
    }

    .status-entrega {
        padding: 1.25rem 1.5rem;
        margin-top: 1.5rem;
        width: fit-content; /* Ajusta ao tamanho do conteúdo */
        max-width: 100%; /* Não ultrapassa o container */
    }

    .breadcrumb {
        font-size: 1rem; /* 16px no desktop */
    }
    
    .timeline-titulo {
        font-size: 1rem;
    }
    
    .timeline-descricao {
        font-size: 0.875rem;
    }

    /* Footer Desktop */
    .footer {
        background: url('../images/rodape-mobile.svg') center/cover no-repeat;
        padding: 2rem 1rem;
        color: var(--cor-azul-escuro);
    }

    .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(--cor-azul-escuro);
        font-weight: 400;
        margin-bottom: 0;
        padding-bottom: 0;
        font-size: 0.875rem;
        line-height: 1.4;
    }

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

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