/* 1. Reseteo y fondo */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(120deg, #f9f6f0 0%, #eaf6ef 100%);
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-anim {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: none;
}
.background-anim::before,
.background-anim::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    opacity: .22;
    filter: blur(2px);
}
.background-anim::before {
    width: 340px; height: 340px; left: -120px; top: 60px;
    background: #eedbaf;
    animation: blobmove1 12s ease-in-out infinite alternate;
}
.background-anim::after {
    width: 220px; height: 220px; right: 50px; top: 200px;
    background: #b7c3b3;
    animation: blobmove2 14s ease-in-out infinite alternate;
}
@keyframes blobmove1 {
    0% { left: -120px; top: 60px;}
    100% { left: 30px; top: 120px;}
}
@keyframes blobmove2 {
    0% { right: 50px; top: 200px;}
    100% { right: 0px; top: 350px;}
}

/* 2. Centrado y responsivo */
.main-flex {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    position: relative;
    z-index: 1;
}

.container {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 3px 32px #102b3317;
    padding: 2.2em 1.6em 2em 1.6em;
    max-width: 420px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    position: relative;
}

.logo-abc {
    width: 78px;
    display: block;
    margin: 0 auto 0.5em auto;
}

.tracking-title {
    font-size: 1.4em;
    text-align: center;
    margin: 0 0 1.2em 0;
    font-weight: 700;
    color: #1b403a;
    letter-spacing: 0.04em;
}

.tracking-form {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1.4em;
}
.tracking-form input {
    flex: 1 1 200px;
    border: 1.5px solid #bbb;
    padding: 0.7em 1em;
    border-radius: 10px;
    font-size: 1em;
    background: #f8fbf9;
    outline: none;
    transition: border .2s;
}
.tracking-form input:focus {
    border-color: #2a86d1;
}
.btn-buscar {
    background: linear-gradient(90deg, #eebd34 40%, #ffe3a7 100%);
    border: none;
    color: #27323a;
    font-weight: 600;
    padding: 0.7em 1.2em;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background .18s;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.btn-buscar:hover { background: #eebd34; }

/* --- Modern result area --- */
.result-area {
    min-height: 58px;
    margin-top: 1.2em;
    margin-bottom: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px #0002;
    margin-bottom: 2rem;
    border: 1.5px solid #e3e8ee;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    padding: 1.5em 1.2em 1.2em 1.2em;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7em;
}

.tracking-main-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7em 1.2em;
    margin-bottom: 1.1em;
    border-bottom: 1px solid #e3e8ee;
    padding-bottom: 1em;
}

.tracking-info-body {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em 1.2em;
    margin-bottom: 0.7em;
}

.tracking-info-body div {
    font-size: 1em;
    color: #2a3a3a;
    margin-bottom: 0.2em;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.tracking-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.7em;
    margin-top: 0.7em;
    justify-content: flex-end;
}

.btn-action, .action-btn {
    background: #f7faf9;
    border: 1px solid #e3e8ee;
    color: #17695b;
    font-weight: 600;
    padding: 0.6em 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background .16s, box-shadow .13s;
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1em;
}

.btn-action:hover, .action-btn:hover {
    background: #eaf6ef;
    box-shadow: 0 2px 8px #0001;
}

.events-wrap {
    margin-top: 1.2em;
    padding-top: 0.7em;
    border-top: 1px solid #e3e8ee;
}

.events {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    margin-top: 0.5em;
}

.event-row {
    background: #f8fbf9;
    border-radius: 8px;
    padding: 0.6em 1em;
    box-shadow: 0 1px 4px #0001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.98em;
}

.event-desc {
    font-weight: 500;
    color: #17695b;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.event-date {
    color: #888;
    font-size: 0.97em;
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.not-found, .tracking-error, .error {
    background: #fff7e6;
    color: #b85c00;
    border-radius: 8px;
    padding: 1em 1.2em;
    margin-top: 1em;
    box-shadow: 0 1px 6px #0001;
    font-size: 1.08em;
}

.card-content {
    padding: 1.1em 1.2em;
    font-size: 1em;
}
.img-list {
    margin-bottom: 0.9em;
    display: flex;
    gap: 0.5em;
}
.img-paquete {
    max-width: 84px;
    max-height: 72px;
    border-radius: 8px;
    box-shadow: 0 1px 6px #0002;
    cursor: pointer;
    border: 2px solid #eaeaea;
    transition: transform .13s;
}
.img-paquete:hover { transform: scale(1.12); }

.card h2 {
    margin: 0 0 0.5em 0;
    font-size: 1.05em;
    color: #17695b;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.card b { color: #444; }

.card-actions {
    margin-top: 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em;
}
.action-btn {
    background: #eaf6ef;
    border: none;
    color: #135047;
    font-weight: 600;
    padding: 0.6em 1.3em;
    border-radius: 8px;
    cursor: pointer;
    transition: background .16s, box-shadow .13s;
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1em;
}
.action-btn:hover { background: #c6ede6; }
.action-btn:active { background: #b6dcd2; }

/* --- Loader/Buscando --- */
.tracking-status.busy {
    background: #eaf6ef;
    color: #17695b;
    border-radius: 8px;
    padding: 0.7em 1.2em;
    margin: 1.2em auto 1.2em auto;
    font-size: 1.12em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
    box-shadow: 0 1px 6px #0001;
    width: fit-content;
    animation: pulseLoader 1.2s infinite;
}
@keyframes pulseLoader {
    0% { box-shadow: 0 1px 6px #0001; }
    50% { box-shadow: 0 2px 12px #17695b22; }
    100% { box-shadow: 0 1px 6px #0001; }
}
.tracking-status.busy i {
    animation: spinLoader 1.1s linear infinite;
}
@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 4. Modal imagen */
.modal {
    display: none;
    position: fixed;
    z-index: 12;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.57);
}
.modal-content {
    display: block;
    margin: 5% auto;
    max-width: 96vw;
    max-height: 88vh;
    border-radius: 13px;
    box-shadow: 0 2px 20px #0007;
    border: 4px solid #fff;
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 28px;
    color: #fff;
    font-size: 2.2em;
    font-weight: 900;
    cursor: pointer;
    z-index: 20;
}
@media (max-width: 600px) {
    .container {
        max-width: 98vw;
        padding: 1em 0.4em 1.2em 0.4em;
        border-radius: 0.8em;
    }
    .tracking-title { font-size: 1.1em; }
    .main-flex { min-height: 95vh; }
    .img-paquete { max-width: 60px; max-height: 54px; }
    .card-content { font-size: 0.98em; }
    .action-btn { font-size: 0.96em; padding: 0.6em 0.8em; }
}

footer {
    text-align: center;
    font-size: .97em;
    color: #768c88;
    margin-bottom: 1.1em;
    z-index: 1;
    position: relative;
}
footer a {
    color: #228d7b;
    text-decoration: none;
    font-weight: 500;
}
footer a:hover { text-decoration: underline; }

