/* RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #0a0f1a;
    color: #e5e7eb;
    position: relative;
    overflow-x: hidden;
}

/* FONDO: BLUR MÁS BAJO */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(8, 47, 73, 0.35), transparent 55%),
        url("/assets/images/X.webp");
    background-size: cover;
    background-position: center;
    filter: blur(7px) saturate(1.05);
    transform: scale(1.02);
    opacity: 0.65;
    z-index: -2;
}

/* Capa oscura ligera */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10,15,26,0.8), rgba(10,15,26,0.94));
    z-index: -1;
}

/* CONTENEDOR */
#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
}

/* TARJETA */
.trk-page {
    width: 100%;
    max-width: 840px;
    border-radius: 22px;
    padding: 26px 32px 26px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow:
        0 20px 45px rgba(0,0,0,0.55),
        0 0 0 1px rgba(59, 130, 246, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* TÍTULO */
.trk-title {
    font-size: 1.9rem;
    font-weight: 650;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.trk-title::before {
    content: "";
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    box-shadow: 0 0 12px rgba(56,189,248,0.6);
}

.trk-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

/* INPUT */
.trk-input {
    flex: 1 1 auto;
    border-radius: 999px;
    border: 1px solid rgba(100,116,139,0.6);
    padding: 0.85rem 1.2rem;
    background: rgba(30,41,59,0.9);
    color: #f1f5f9;
    font-size: 0.95rem;
    transition: 0.15s ease;
}

.trk-input::placeholder {
    color: #94a3b8;
}

.trk-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px #38bdf8;
}

/* BOTÓN */
.trk-btn {
    border-radius: 999px;
    border: none;
    padding: 0.85rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f8fafc;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.18s ease;
}

.trk-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.65' y1='16.65' x2='21' y2='21'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.trk-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* RESULTADO */
.trk-result { margin-top: 1rem; }

/* CARD RESULT */
.trk-card {
    margin-top: 0.3rem;
    border-radius: 18px;
    padding: 20px;
    background: rgba(15,23,42,0.93);
    border: 1px solid rgba(59,130,246,0.25);
    box-shadow: 0 12px 35px rgba(0,0,0,0.45);
}

/* HEADER */
.trk-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.trk-code {
    font-family: "JetBrains Mono", monospace;
    background: rgba(30,41,59,0.6);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    color: #f1f5f9;
    letter-spacing: 0.14em;
}

/* ESTADO */
.trk-chip {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #022c22;
}

/* LOCALIDADES */
.trk-locs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem 1rem;
    color: #e2e8f0;
    margin-bottom: 1.2rem;
}

.trk-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 0.4rem;
}

/* TIMELINE */
.trk-history {
    background: rgba(15,23,42,0.85);
    border-radius: 12px;
    border: 1px dashed rgba(59,130,246,0.35);
    padding: 0.7rem;
    max-height: 240px;
    overflow-y: auto;
}

.trk-step {
    padding: 0.45rem;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.6rem;
}

.trk-step + .trk-step {
    border-top: 1px dashed rgba(59,130,246,0.2);
}

.trk-step-time {
    font-size: 0.75rem;
    color: #8ca3c2;
}

.trk-step-status {
    font-weight: 600;
    color: #f8fafc;
}

.trk-step-note {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* PROOFS */
.trk-proofs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.trk-proof-link {
    background: rgba(30,41,59,0.7);
    color: #e2e8f0;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid rgba(59,130,246,0.25);
}

.trk-proof-link:hover {
    background: rgba(59,130,246,0.4);
}

/* ESTADOS */
.trk-error {
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(127,29,29,0.85);
    border: 1px solid rgba(248,113,113,0.85);
}

/* RESPONSIVE */
@media (max-width: 720px) {
    .trk-form { flex-direction: column; }
    .trk-card-header { flex-direction: column; align-items: flex-start; }
    .trk-step { grid-template-columns: 1fr; }
}
