/* ============================================
   J&T EXPRESS - RASTREAMENTO & COBRANÇA
   ============================================ */

:root {
    --red-primary: #e60000;
    --red-dark: #c20000;
    --red-light: #fff1f1;
    --red-bg: #fef2f2;
    --green-success: #16a34a;
    --green-light: #f0fdf4;
    --yellow-warning: #f59e0b;
    --yellow-light: #fffbeb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--red-primary) 0%, #ff1a1a 50%, var(--red-dark) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(230, 0, 0, 0.25);
}

.header-inner {
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

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

.logo-fallback {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.logo-jt {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
}

.logo-express {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* CONTAINER */
.container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* CARDS */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header-red {
    background: var(--red-primary);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-red h1,
.card-header-red h2 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.card-header-red svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.card-header-white {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header-white h2 {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-header-white svg {
    width: 20px;
    height: 20px;
    color: var(--red-primary);
    flex-shrink: 0;
}

.card-body {
    padding: 20px;
}

/* SAFE REMINDER */
.safe-reminder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--green-light);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid #bbf7d0;
}

.safe-reminder .icon-shield {
    width: 18px;
    height: 18px;
    color: var(--green-success);
    flex-shrink: 0;
}

.safe-reminder span {
    font-size: 0.813rem;
    color: #166534;
    font-weight: 500;
}

/* FORM */
.input-label {
    display: block;
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    background: var(--white);
}

.input-group:focus-within {
    border-color: var(--red-primary);
    box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.12), 0 4px 12px rgba(230, 0, 0, 0.08);
    transform: translateY(-1px);
}

.input-group:hover:not(:focus-within) {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.input-group input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-800);
    background: transparent;
    min-width: 0;
    transition: color 0.2s ease;
}

.input-group input::placeholder {
    color: var(--gray-400);
    transition: color 0.3s ease;
}

.input-group input:focus::placeholder {
    color: var(--gray-300);
}

#btn-consultar {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    color: var(--white);
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

#btn-consultar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

#btn-consultar:hover {
    background: linear-gradient(135deg, var(--red-dark), #a50000);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.35);
}

#btn-consultar:hover::after {
    width: 200px;
    height: 200px;
}

#btn-consultar:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(230, 0, 0, 0.25);
}

#btn-consultar:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--white), 0 0 0 3px var(--red-primary);
}

.btn-spinner {
    width: 18px;
    height: 18px;
}

.error-msg {
    display: block;
    font-size: 0.813rem;
    color: var(--red-primary);
    margin-top: 8px;
    font-weight: 500;
}

.info-text {
    font-size: 0.813rem;
    color: var(--gray-500);
    margin-top: 16px;
    text-align: center;
}

/* INFO GRID (resultado) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    word-break: break-word;
}

.tracking-code {
    font-family: 'Courier New', monospace;
    color: var(--red-primary);
    font-size: 0.813rem;
    background: var(--red-light);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

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

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--gray-300);
}

.timeline-item:first-child .timeline-dot {
    background: var(--red-primary);
    box-shadow: 0 0 0 2px var(--red-primary);
    width: 14px;
    height: 14px;
    left: -21px;
    top: 5px;
}

.timeline-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
    margin-bottom: 4px;
}

.timeline-item:first-child .timeline-text {
    font-weight: 600;
    color: var(--gray-900);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
}

.timeline-status {
    display: inline-block;
    font-size: 0.688rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    margin-top: 4px;
}

.timeline-status.entregue {
    background: var(--green-light);
    color: var(--green-success);
}

.timeline-status.transito {
    background: #eff6ff;
    color: #2563eb;
}

.timeline-status.coletado {
    background: var(--yellow-light);
    color: #b45309;
}

/* TAXA ALERT */
.card-taxa {
    border: 2px solid #fbbf24;
    background: var(--yellow-light);
}

.taxa-alert {
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.taxa-icon svg {
    width: 28px;
    height: 28px;
    color: var(--yellow-warning);
    flex-shrink: 0;
}

.taxa-content h3 {
    font-size: 0.938rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.taxa-content p {
    font-size: 0.813rem;
    color: #a16207;
    line-height: 1.5;
    margin-bottom: 12px;
}

.taxa-valor {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.taxa-label {
    font-size: 0.813rem;
    font-weight: 500;
    color: #a16207;
}

.taxa-amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #92400e;
}

.btn-pagar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 14px 20px;
    background: var(--red-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.938rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-pagar:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
}

.btn-pagar:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.3);
}

.btn-pagar .icon-pix {
    width: 20px;
    height: 20px;
}

/* BTN VOLTAR */
.btn-voltar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}

.btn-voltar:hover {
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-voltar:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn-voltar svg {
    width: 18px;
    height: 18px;
}

/* PAGAMENTO PIX */
.pix-body {
    text-align: center;
}

.pix-valor-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
}

.pix-valor-label {
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pix-valor-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
}

.pix-qr-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 20px;
}

.pix-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.pix-loading .spin {
    width: 32px;
    height: 32px;
}

#pix-qrcode {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-sm);
    border: 4px solid var(--gray-100);
}

/* COPIA E COLA */
.pix-copiacola {
    margin-bottom: 20px;
    text-align: left;
}

.copy-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.copy-group input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    outline: none;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: var(--gray-600);
    background: var(--gray-50);
    min-width: 0;
    text-overflow: ellipsis;
}

.btn-copiar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gray-800);
    color: var(--white);
    border: none;
    font-size: 0.813rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.btn-copiar:hover {
    background: var(--gray-700);
}

.btn-copiar:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--white);
}

.btn-copiar svg {
    width: 16px;
    height: 16px;
}

.copy-feedback {
    display: block;
    font-size: 0.75rem;
    color: var(--green-success);
    font-weight: 600;
    margin-top: 6px;
}

/* PIX STATUS */
.pix-status {
    margin-bottom: 16px;
}

.status-waiting,
.status-paid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-waiting {
    background: var(--yellow-light);
    color: #b45309;
}

.status-paid {
    background: var(--green-light);
    color: var(--green-success);
}

.status-paid svg {
    width: 20px;
    height: 20px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--yellow-warning);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.pix-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--gray-400);
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

.pix-timer svg {
    width: 14px;
    height: 14px;
}

/* CONFIRMAÇÃO */
.card-confirmacao {
    text-align: center;
    padding: 32px 20px;
}

.success-icon-area {
    margin-bottom: 20px;
}

.success-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--green-success);
    border-radius: 50%;
    animation: scaleIn 0.4s ease;
}

.success-circle svg {
    width: 32px;
    height: 32px;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.card-confirmacao h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-details {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 24px;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confirm-label {
    font-size: 0.813rem;
    color: var(--gray-500);
    font-weight: 500;
}

.confirm-value {
    font-size: 0.875rem;
    color: var(--gray-800);
    font-weight: 600;
}

.confirm-tx {
    font-family: 'Courier New', monospace;
    font-size: 0.688rem;
    max-width: 140px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.card-confirmacao .btn-pagar {
    width: 100%;
    margin: 0;
}

/* RESPONSIVO */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pix-valor-amount {
        font-size: 1.75rem;
    }

    #pix-qrcode {
        width: 180px !important;
        height: 180px !important;
    }
}

/* ANIMAÇÕES */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-up {
    animation: slideUp 0.4s ease;
}

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

/* FOOTER */
.footer {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: var(--white);
    text-align: center;
    padding: 20px 16px;
    margin-top: auto;
    width: 100%;
}

.footer-inner {
    max-width: 480px;
    margin: 0 auto;
}

.footer-brand {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.footer-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.footer-divider {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 12px auto;
    border-radius: 2px;
}

.footer-copy {
    font-size: 0.688rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}
