/* =========================================================
   TecnoSpTest
   assets/css/speedtest.css
   Diseño profesional v3
========================================================= */

:root {
    --bg-top: #073f57;
    --bg-main: #06475f;
    --bg-bottom: #053c52;

    --text-main: #f7fbfd;
    --text-soft: #d3e5ec;
    --text-muted: #8fb4c3;

    --cyan: #8edcff;
    --cyan-light: #b7ecff;
    --yellow: #ffe500;
    --yellow-light: #fff45c;

    --track: rgba(111, 168, 190, 0.24);
    --track-dark: rgba(2, 32, 45, 0.24);

    --panel: rgba(255, 255, 255, 0.025);
    --panel-hover: rgba(255, 255, 255, 0.045);

    --border: rgba(255, 255, 255, 0.07);

    --button: #91ddfb;
    --button-hover: #b3ebff;

    --shadow:
        0 18px 45px rgba(0, 20, 30, 0.16);

    --transition: 0.25s ease;
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family:
        "Segoe UI",
        Inter,
        Roboto,
        Arial,
        sans-serif;

    color: var(--text-main);

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(142, 220, 255, 0.09),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            var(--bg-top) 0%,
            var(--bg-main) 48%,
            var(--bg-bottom) 100%
        );

    overflow-x: hidden;
}


/* =========================================================
   FONDO DECORATIVO
========================================================= */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 15% 25%,
            rgba(142, 220, 255, 0.035),
            transparent 22%
        ),
        radial-gradient(
            circle at 85% 70%,
            rgba(255, 229, 0, 0.025),
            transparent 24%
        );

    z-index: -1;
}


/* =========================================================
   APP
========================================================= */

.speed-app {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    width: 100%;

    padding:
        30px
        20px
        24px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.08),
            transparent
        );

    border-bottom:
        1px solid rgba(255, 255, 255, 0.025);
}


/* =========================================================
   MARCA
========================================================= */

.brand {
    margin-bottom: 8px;

    font-size: 0.74rem;

    font-weight: 700;

    letter-spacing: 2.8px;

    text-transform: uppercase;
}

.brand-tecno {
    color: var(--text-main);
}

.brand-test {
    color: var(--cyan);
}

img{
width: 152px;

}

/* =========================================================
   TÍTULO
========================================================= */

.hero h1 {
    font-size:
        clamp(2.1rem, 5vw, 3.2rem);

    line-height: 1;

    font-weight: 300;

    letter-spacing: 0.5px;
}

.hero h1 span {
    color: var(--cyan);

    font-weight: 300;
}

.hero-subtitle {
    margin-top: 12px;

    color: var(--text-muted);

    font-size: 0.82rem;

    font-weight: 300;
}


/* =========================================================
   INFORMACIÓN DE RED
========================================================= */

.network-info {
    width:
        min(700px, calc(100% - 32px));

    margin:
        20px
        auto
        0;

    display: flex;
    align-items: stretch;

    padding:
        14px
        20px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background:
        rgba(0, 22, 32, 0.13);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.network-item {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;
}

.network-label {
    color: var(--text-muted);

    font-size: 0.64rem;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.network-item strong {
    width: 100%;

    color: var(--text-soft);

    font-size: 0.82rem;

    font-weight: 500;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.network-separator {
    width: 1px;

    margin:
        0
        22px;

    background:
        rgba(255, 255, 255, 0.08);
}


/* =========================================================
   CONTROL DEL TEST
========================================================= */

.test-control {
    width:
        min(700px, calc(100% - 32px));

    margin:
        28px
        auto
        5px;

    display: flex;
    flex-direction: column;

    align-items: center;
}


/* =========================================================
   BOTÓN
========================================================= */

.start-button {
    width: 140px;
    height: 50px;

    border: none;

    border-radius: 8px;

    cursor: pointer;

    color: #05384c;

    background:
        linear-gradient(
            180deg,
            var(--button-hover),
            var(--button)
        );

    font-size: 0.9rem;

    font-weight: 600;

    box-shadow:
        0 10px 26px rgba(0, 24, 35, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        opacity var(--transition);
}

.start-button:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 14px 30px rgba(0, 24, 35, 0.26),
        0 0 18px rgba(142, 220, 255, 0.10);
}

.start-button:active {
    transform:
        translateY(0);
}

.start-button:disabled {
    cursor: not-allowed;

    opacity: 0.58;

    transform: none;
}


/* =========================================================
   ESTADO
========================================================= */

.test-state {
    margin-top: 13px;

    display: flex;
    align-items: center;

    gap: 7px;

    color: var(--text-muted);

    font-size: 0.72rem;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--cyan);

    box-shadow:
        0 0 10px rgba(142, 220, 255, 0.7);
}

.status-dot.testing {
    animation:
        statusPulse
        0.9s
        infinite;
}

.status-dot.error {
    background: #ff7474;

    box-shadow:
        0 0 10px rgba(255, 116, 116, 0.7);
}


/* =========================================================
   MENSAJE
========================================================= */

.test-message {
    min-height: 18px;

    margin-top: 8px;

    color: var(--text-muted);

    text-align: center;

    font-size: 0.74rem;
}


/* =========================================================
   PROGRESO GENERAL
========================================================= */

.global-progress {
    width:
        min(100%, 420px);

    height: 3px;

    margin-top: 13px;

    overflow: hidden;

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.08);
}

.global-progress-bar {
    width: 0%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--cyan),
            var(--yellow)
        );

    transition:
        width
        0.25s
        ease;
}


/* =========================================================
   GRID PRINCIPAL
========================================================= */

.meters-grid {
    width:
        min(760px, calc(100% - 28px));

    margin:
        22px
        auto
        30px;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        28px
        34px;
}


/* =========================================================
   TARJETA DEL MEDIDOR
========================================================= */

.meter-card {
    min-width: 0;

    position: relative;

    padding:
        18px
        14px
        20px;

    text-align: center;

    border:
        1px solid transparent;

    border-radius: 22px;

    background:
        var(--panel);

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.meter-card:hover {
    transform:
        translateY(-2px);

    background:
        var(--panel-hover);

    border-color:
        rgba(255, 255, 255, 0.045);
}

.meter-card.active {
    border-color:
        rgba(255, 255, 255, 0.07);

    box-shadow:
        var(--shadow);
}


/* =========================================================
   TÍTULO DE MEDIDOR
========================================================= */

.meter-card h2 {
    margin-bottom: 8px;

    color: var(--text-soft);

    font-size: 1.08rem;

    font-weight: 300;

    letter-spacing: 0.2px;
}


/* =========================================================
   CONTENEDOR DEL MEDIDOR
========================================================= */

.meter-gauge {
    position: relative;

    width:
        min(100%, 300px);

    aspect-ratio:
        1 / 0.72;

    margin:
        0
        auto;

    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================================================
   SVG DEL MEDIDOR
========================================================= */

.meter-svg {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    display: block;

    overflow: visible;
}


/* =========================================================
   ARCOS
========================================================= */

.meter-track,
.meter-progress {
    fill: none;

    stroke-width: 15;

    stroke-linecap: round;
}

.meter-track {
    stroke:
        var(--track);
}

.meter-progress {
    transition:
        stroke-dashoffset
        0.20s
        linear;
}


/* =========================================================
   COLORES
========================================================= */

.meter-download .meter-progress {
    stroke: var(--cyan);
}

.meter-upload .meter-progress {
    stroke: var(--yellow);
}

.meter-ping .meter-progress {
    stroke: var(--yellow);
}

.meter-jitter .meter-progress {
    stroke: var(--cyan);
}


/* =========================================================
   VALOR CENTRAL
========================================================= */

.meter-value {
    position: absolute;

    left: 50%;
    top: 64%;

    transform:
        translate(-50%, -50%);

    width: 76%;

    min-height: 82px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    pointer-events: none;

    z-index: 3;
}

.meter-value strong {
    display: block;

    width: 100%;

    margin: 0;

    color: var(--text-main);

    font-size:
        clamp(2.15rem, 5vw, 3rem);

    line-height: 1;

    font-weight: 300;

    letter-spacing: -1.8px;

    text-align: center;

    font-variant-numeric:
        tabular-nums lining-nums;

    white-space: nowrap;
}

.meter-value span {
    display: block;

    width: 100%;

    margin-top: 10px;

    color: var(--text-soft);

    font-size: 0.74rem;

    font-weight: 300;

    line-height: 1;

    text-align: center;
}


/* =========================================================
   LÍNEA INFERIOR
========================================================= */

.meter-line {
    width: 108px;
    height: 4px;

    margin:
        2px
        auto
        0;

    border-radius: 999px;

    background:
        rgba(120, 175, 195, 0.20);
}


/* =========================================================
   EFECTOS ACTIVOS
========================================================= */

.meter-download.active .meter-progress,
.meter-jitter.active .meter-progress {
    filter:
        drop-shadow(
            0 0 6px
            rgba(142, 220, 255, 0.55)
        );
}

.meter-upload.active .meter-progress,
.meter-ping.active .meter-progress {
    filter:
        drop-shadow(
            0 0 6px
            rgba(255, 229, 0, 0.48)
        );
}

.meter-card.active .meter-value strong {
    text-shadow:
        0 0 18px rgba(255, 255, 255, 0.08);
}


/* =========================================================
   SERVIDOR
========================================================= */

.server-info {
    width:
        min(760px, calc(100% - 32px));

    margin:
        0
        auto
        26px;

    padding:
        17px
        12px
        0;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

    border-top:
        1px solid rgba(255, 255, 255, 0.06);
}

.server-item {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 5px;

    text-align: center;
}

.server-item span {
    color: var(--text-muted);

    font-size: 0.64rem;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.server-item strong {
    max-width: 100%;

    color: var(--text-soft);

    font-size: 0.8rem;

    font-weight: 400;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   COMPATIBILIDAD
========================================================= */

.compatibility-elements {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;

    opacity: 0;

    pointer-events: none;

    clip-path:
        inset(100%);
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    margin-top: auto;

    padding:
        19px
        16px;

    text-align: center;

    color:
        rgba(200, 220, 229, 0.46);

    font-size: 0.68rem;

    border-top:
        1px solid rgba(255, 255, 255, 0.04);
}


/* =========================================================
   ANIMACIÓN
========================================================= */

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;

        transform:
            scale(1);
    }

    50% {
        opacity: 0.35;

        transform:
            scale(1.4);
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 760px) {

    .meters-grid {
        width:
            min(680px, calc(100% - 20px));

        gap:
            20px
            16px;
    }

    .meter-card {
        padding:
            16px
            8px
            18px;
    }

    .meter-gauge {
        width:
            min(100%, 280px);
    }
}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 540px) {

    .hero {
        padding:
            22px
            12px
            18px;
    }

    .brand {
        font-size: 0.66rem;

        letter-spacing: 2px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.72rem;
    }


    /* Red */

    .network-info {
        width:
            calc(100% - 20px);

        padding:
            11px
            12px;

        border-radius: 11px;
    }

    .network-separator {
        margin:
            0
            10px;
    }

    .network-item strong {
        font-size: 0.7rem;
    }


    /* Control */

    .test-control {
        width:
            calc(100% - 20px);

        margin-top: 22px;
    }

    .start-button {
        width: 128px;
        height: 47px;
    }


    /* Grid */

    .meters-grid {
        width:
            calc(100% - 12px);

        gap:
            14px
            6px;

        margin-top: 18px;
    }


    /* Tarjetas */

    .meter-card {
        padding:
            12px
            3px
            16px;

        border-radius: 16px;
    }

    .meter-card h2 {
        margin-bottom: 3px;

        font-size: 0.92rem;
    }


    /* Gauge */

    .meter-gauge {
        width: 100%;

        aspect-ratio:
            1 / 0.74;
    }

    .meter-track,
    .meter-progress {
        stroke-width: 13;
    }


    /* Valor */

    .meter-value {
        top: 64%;

        width: 82%;

        min-height: 64px;
    }

    .meter-value strong {
        font-size:
            clamp(1.55rem, 8vw, 2.15rem);

        letter-spacing: -1.2px;
    }

    .meter-value span {
        margin-top: 7px;

        font-size: 0.64rem;
    }

    .meter-line {
        width: 78px;

        height: 4px;
    }


    /* Servidor */

    .server-info {
        width:
            calc(100% - 24px);

        gap: 10px;
    }
}


/* =========================================================
   MÓVIL PEQUEÑO
========================================================= */

@media (max-width: 370px) {

    .hero h1 {
        font-size: 1.55rem;
    }

    .network-info {
        flex-direction: column;

        gap: 9px;
    }

    .network-separator {
        width: 100%;
        height: 1px;

        margin: 0;
    }

    .meters-grid {
        gap:
            12px
            3px;
    }

    .meter-card h2 {
        font-size: 0.82rem;
    }

    .meter-value strong {
        font-size: 1.48rem;
    }

    .meter-track,
    .meter-progress {
        stroke-width: 12;
    }
}