:root {
    --lg-teal: #13838E;
    --lg-teal-dark: #0C6670;
    --lg-teal-light: #DCF0F1;
    --lg-magenta: #A6036D;
    --lg-ink: #16232C;
    --lg-ink-soft: #4B5C66;
    --lg-paper: #FAFCFC;
    --lg-surface: #FFFFFF;
    --lg-mist: #E4ECED;
    --lg-radius: 14px;
    --lg-ease-out: cubic-bezier(.23, 1, .32, 1);
    --lg-font-ui: 'Inter', sans-serif;
    --lg-font-mono: 'JetBrains Mono', monospace;
}

[data-bs-theme="dark"] {
    --lg-ink: #EAF1F2;
    --lg-ink-soft: #93A7AD;
    --lg-paper: #0B161C;
    --lg-surface: #101F27;
    --lg-mist: #1C2E36;
    --lg-teal-light: #123339;
}

html,
body {
    background: var(--lg-paper);
    color: var(--lg-ink);
    font-family: var(--lg-font-ui);
}

html,
body,
.navbar,
.card,
.btn,
input,
textarea,
select {
    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* ------------------------------------------------------------
   NAVBAR
   ------------------------------------------------------------ */

.lg-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: color-mix(in srgb, var(--lg-surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--lg-mist);
}

.lg-nav .container {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lg-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: inherit;
}

.lg-brand-logo {
    width: 40px;
    height: auto;
    flex-shrink: 0;
}

.lg-brand-word {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.lg-brand-word b {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    color: var(--lg-ink);
}

.lg-brand-word span {
    font-family: var(--lg-font-mono);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lg-teal);
}

.lg-links {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lg-links a {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: .92rem;
    text-decoration: none;
    color: var(--lg-ink-soft);
    position: relative;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

.lg-links a:hover {
    color: var(--lg-ink);
    background: var(--lg-mist);
}

.lg-links a.active {
    color: var(--lg-teal);
    background: var(--lg-teal-light);
    font-weight: 600;
}

.lg-links a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    translate: -50% 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lg-magenta);
}

.lg-util {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.lg-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--lg-mist);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--lg-ink-soft);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s var(--lg-ease-out), color .2s var(--lg-ease-out), transform .2s var(--lg-ease-out);
}

.lg-icon-btn:hover {
    border-color: var(--lg-teal);
    color: var(--lg-teal);
    transform: translateY(-1px);
}

.lg-icon-btn:active {
    transform: scale(.96);
}

.lg-icon-btn.lg-track-btn {
    background: var(--lg-teal);
    color: #fff;
    border-color: transparent;
}

.lg-icon-btn.lg-track-btn:hover {
    background: var(--lg-teal-dark);
    color: #fff;
}

.lg-lang-btn span {
    font-family: var(--lg-font-mono);
    font-size: .72rem;
    font-weight: 600;
}

.navbar-toggler {
    border: 1px solid var(--lg-mist);
    background: transparent;
    box-shadow: none !important;
}

/* Línea de "ruta" — firma visual */
.lg-route {
    height: 2px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--lg-mist);
}

.lg-route::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, var(--lg-teal) 0 22px, transparent 22px 34px);
    animation: lgRouteMove 3.2s linear infinite;
    opacity: .55;
}

@keyframes lgRouteMove {
    from { transform: translateX(0); }
    to { transform: translateX(-56px); }
}

@media (max-width: 991.98px) {

    .lg-nav .container {
        flex-wrap: wrap;
        height: auto;
        padding-top: .6rem;
        padding-bottom: .6rem;
    }

    .lg-links {
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        width: 100%;
        padding: .75rem 0 1.1rem;
        border-top: 1px solid var(--lg-mist);
        margin-top: .5rem;
    }

    .lg-links a {
        width: 100%;
        padding: .75rem 1rem;
    }

    .lg-links a.active::after {
        display: none;
    }

    .lg-links.show a {
        opacity: 0;
        transform: translateY(-6px);
        animation: lgItemIn .28s var(--lg-ease-out) forwards;
    }

    .lg-links.show a:nth-child(1) { animation-delay: .02s; }
    .lg-links.show a:nth-child(2) { animation-delay: .06s; }
    .lg-links.show a:nth-child(3) { animation-delay: .10s; }
    .lg-links.show a:nth-child(4) { animation-delay: .14s; }
    .lg-links.show a:nth-child(5) { animation-delay: .18s; }
}

@keyframes lgItemIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .lg-links {
        display: flex !important;
        height: auto !important;
    }
}

/* ------------------------------------------------------------
   MODAL DE RASTREO
   ------------------------------------------------------------ */

.lg-modal .modal-content {
    border: none;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35);
    background: var(--lg-paper);
}

.lg-modal .modal-header {
    position: relative;
    border-bottom: none;
    padding: 1.75rem 1.75rem 3rem;
    background: linear-gradient(135deg, var(--lg-teal), var(--lg-teal-dark));
    color: #fff;
}

.lg-modal .modal-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
    mask-image: linear-gradient(to bottom, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

.lg-modal .lg-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: .65rem;
    position: relative;
}

.lg-modal .modal-title {
    color: #fff;
    position: relative;
}

.lg-modal .modal-subtitle {
    color: rgba(255, 255, 255, .85);
    font-size: .85rem;
    position: relative;
    margin-top: .15rem;
}

.lg-modal .lg-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    filter: brightness(0) invert(1);
    opacity: .9;
    z-index: 2;
}

.lg-modal .modal-body {
    padding: 0 0 1.75rem;
}

.lg-track-card {
    background: var(--lg-surface);
    border: 1px solid var(--lg-mist);
    border-radius: 18px;
    padding: 1.5rem;
    margin: -2.4rem 1.75rem 0;
    position: relative;
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .18);
}

@media (max-width: 575.98px) {
    .lg-track-card {
        margin: -2.4rem 1rem 0;
        padding: 1.1rem;
    }
}

.track-illustration {
    display: block;
    width: 100%;
    height: auto;
    max-height: 56px;
    margin-bottom: 1.25rem;
}

.lg-provider-toggle {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
}

.lg-provider-toggle input {
    display: none;
}

.lg-provider-toggle label {
    flex: 1;
    text-align: center;
    padding: .55rem .5rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid var(--lg-mist);
    color: var(--lg-ink-soft);
    cursor: pointer;
    transition: background-color .18s var(--lg-ease-out), border-color .18s var(--lg-ease-out), color .18s var(--lg-ease-out);
}

.lg-provider-toggle input:checked + label {
    background: var(--lg-teal-light);
    border-color: var(--lg-teal);
    color: var(--lg-teal);
}

.track-input-group {
    position: relative;
}

.track-input-group .bi-upc-scan {
    position: absolute;
    left: 14px;
    top: 50%;
    translate: 0 -50%;
    color: var(--lg-ink-soft);
    z-index: 3;
}

.track-input-group input {
    font-family: var(--lg-font-mono);
    letter-spacing: .03em;
    padding-left: 2.4rem;
}

.track-hint {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .65rem;
}

.lg-track-cta {
    width: 100%;
    padding: .7rem;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    background: var(--lg-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: transform .15s var(--lg-ease-out), background-color .15s ease;
}

.lg-track-cta:hover {
    background: var(--lg-teal-dark);
    color: #fff;
    transform: translateY(-1px);
}

.lg-track-cta:active {
    transform: scale(.98);
}

.lg-track-cta-sm {
    padding: .55rem;
    font-size: .88rem;
}

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */

.lg-footer {
    background: var(--lg-ink);
    color: #EAF1F2;
    padding: 0;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

[data-bs-theme="dark"] .lg-footer {
    background: #070E12;
}

.lg-footer .lg-route {
    background: rgba(255, 255, 255, .08);
}

.lg-footer .lg-route::before {
    opacity: .5;
}

.lg-f-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 2.5rem;
    padding: 3rem 0 2rem;
}

@media (max-width: 767.98px) {
    .lg-f-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.lg-f-logo {
    max-height: 44px;
    width: auto;
}

.lg-f-tag {
    color: #8FA3AA;
    font-size: .9rem;
    margin-top: .5rem;
    max-width: 34ch;
}

.lg-f-title {
    font-family: var(--lg-font-mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #5F7B82;
    margin-bottom: 1rem;
}

.lg-f-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.lg-f-links a {
    color: #C7D6DA;
    text-decoration: none;
    font-size: .92rem;
    transition: color .2s;
}

.lg-f-links a:hover {
    color: #fff;
}

.lg-f-track {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--lg-radius);
    padding: 1.1rem;
}

.lg-f-policies,
.lg-f-policies a {
    color: #7C939A;
}

.lg-f-policies a {
    color: #C7D6DA;
    text-decoration: none;
}

.lg-f-policies a:hover {
    color: #fff;
}

.lg-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 1.15rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .82rem;
    color: #7C939A;
}

.lg-bottom a {
    color: #9FB4B9;
    text-decoration: none;
}

.lg-bottom a:hover {
    color: #fff;
}


/* ------------------------------------------------------------
   Utilidades de sección
   ------------------------------------------------------------ */

.lg-section {
    padding: clamp(3rem, 7vw, 5rem) 0;
}

.lg-section-head {
    text-align: center;
    max-width: 60ch;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
}

.lg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--lg-font-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--lg-teal);
    margin-bottom: .85rem;
}

.lg-eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    background: var(--lg-magenta);
    border-radius: 2px;
}

.lg-section-title {
    font-weight: 800;
    letter-spacing: -.025em;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    color: var(--lg-ink);
    margin-bottom: .6rem;
    line-height: 1.15;
}

.lg-section-sub {
    color: var(--lg-ink-soft);
    font-size: 1rem;
    margin: 0;
}


/* ------------------------------------------------------------
   CÍRCULOS
   ------------------------------------------------------------ */

.lg-circles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (max-width: 991.98px) {
    .lg-circles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 479.98px) {
    .lg-circles-grid { grid-template-columns: 1fr; }
}

.lg-circle-item {
    text-align: center;
}

.lg-circle-media {
    position: relative;
    width: min(220px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--lg-teal), var(--lg-teal-dark));
    transition: transform .3s var(--lg-ease-out);
}

.lg-circle-item:hover .lg-circle-media {
    transform: translateY(-5px);
}

.lg-circle-media img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--lg-paper);
}

/* anillo magenta que aparece en hover */
.lg-circle-media::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed var(--lg-magenta);
    opacity: 0;
    transition: opacity .3s var(--lg-ease-out);
    animation: lgSpin 18s linear infinite;
}

.lg-circle-item:hover .lg-circle-media::after {
    opacity: .8;
}

@keyframes lgSpin {
    to { transform: rotate(360deg); }
}

.lg-circle-item h5 {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--lg-teal);
    margin-bottom: .4rem;
}

.lg-circle-item p {
    font-size: .88rem;
    color: var(--lg-ink-soft);
    margin: 0;
    line-height: 1.55;
}


/* ------------------------------------------------------------
   CONTACTO
   ------------------------------------------------------------ */


.lg-card {
    background: var(--lg-surface);
    border: 1px solid var(--lg-mist);
    border-radius: 20px;
    padding: clamp(1.25rem, 3vw, 1.85rem);
}

.lg-card-head {
    margin-bottom: 1.1rem;
}

.lg-card-head h5 {
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--lg-ink);
    margin-bottom: .25rem;
}

.lg-card-head p {
    color: var(--lg-ink-soft);
    font-size: .86rem;
    margin: 0;
}

/* KAM */
.lg-kam-panel {
    margin-top: 1.25rem;
    border-top: 1px dashed var(--lg-mist);
    padding-top: 1.25rem;
    animation: lgFadeUp .35s var(--lg-ease-out);
}

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

.lg-kam-top {
    display: flex;
    gap: 1.1rem;
    align-items: center;
}

.lg-kam-avatar {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--lg-teal-light);
}

.lg-kam-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--lg-ink);
    margin-bottom: .35rem;
}

.lg-kam-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: 1.1rem;
}

@media (max-width: 575.98px) {
    .lg-kam-top { flex-direction: column; align-items: flex-start; }
    .lg-kam-contacts { grid-template-columns: 1fr; }
}

.lg-kam-field {
    background: var(--lg-paper);
    border: 1px solid var(--lg-mist);
    border-radius: 12px;
    padding: .75rem .9rem;
    min-width: 0;
}

.lg-kam-field small {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--lg-font-mono);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--lg-ink-soft);
    margin-bottom: .3rem;
}

.lg-kam-field p {
    margin: 0;
    font-size: .88rem;
    font-weight: 600;
    color: var(--lg-teal);
    word-break: break-word;
}

/* Formulario */
.lg-form .form-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--lg-ink-soft);
    margin-bottom: .35rem;
}

.lg-form .form-control,
.lg-form .form-select {
    background: var(--lg-paper);
    border: 1px solid var(--lg-mist);
    border-radius: 10px;
    padding: .6rem .8rem;
    font-size: .92rem;
    color: var(--lg-ink);
}

.lg-form .form-control:focus,
.lg-form .form-select:focus,
.lg-card .form-select:focus {
    border-color: var(--lg-teal);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-teal) 18%, transparent);
    background: var(--lg-surface);
}

.lg-card .form-select {
    background-color: var(--lg-paper);
    border: 1px solid var(--lg-mist);
    border-radius: 10px;
    padding: .6rem .8rem;
    font-size: .92rem;
    color: var(--lg-ink);
}

.lg-form-actions {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-top: .25rem;
}

.lg-form-actions .lg-track-cta {
    width: auto;
    padding: .65rem 1.5rem;
}

.lg-char-count {
    font-family: var(--lg-font-mono);
    font-size: .68rem;
    color: var(--lg-ink-soft);
    text-align: right;
    margin-top: .3rem;
}


/* Chips */
.lg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.lg-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    border: 1px solid var(--lg-mist);
    color: var(--lg-ink-soft);
    background: var(--lg-paper);
    white-space: nowrap;
}

.lg-chip-teal {
    background: var(--lg-teal-light);
    border-color: color-mix(in srgb, var(--lg-teal) 35%, transparent);
    color: var(--lg-teal);
}

.lg-chip-magenta {
    background: color-mix(in srgb, var(--lg-magenta) 12%, transparent);
    border-color: color-mix(in srgb, var(--lg-magenta) 35%, transparent);
    color: var(--lg-magenta);
}

[data-bs-theme="dark"] .lg-chip-magenta {
    color: #F06CB8;
}

.lg-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.lg-chip-live .lg-chip-dot {
    animation: lgPulseDot 1.8s ease-in-out infinite;
}

@keyframes lgPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.75); }
}


.lg-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    border: 1px solid var(--lg-mist);
    color: var(--lg-ink-soft);
    background: transparent;
    transition: border-color .2s var(--lg-ease-out), color .2s var(--lg-ease-out), transform .2s var(--lg-ease-out);
}

.lg-btn-ghost:hover {
    border-color: var(--lg-teal);
    color: var(--lg-teal);
    transform: translateY(-1px);
}

/* Banda de sección con fondo diferenciado.
   .lg-cap-band se mantiene como alias por compatibilidad. */
.lg-band,
.lg-cap-band {
    background: var(--lg-surface);
    border-top: 1px solid var(--lg-mist);
    border-bottom: 1px solid var(--lg-mist);
}

/* ------------------------------------------------------------
   Accesibilidad
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .lg-route::before {
        animation: none;
    }

    .lg-links.show a {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .lg-icon-btn:hover,
    .lg-track-cta:hover {
        transform: none;
    }
}

@media (hover: none) {

    .lg-icon-btn:hover,
    .lg-track-cta:hover {
        transform: none;
    }
}
