/* ============================================================
   DESAFÍO EEST N°1
   CSS AISLADO DEL RESTO DEL SITIO
============================================================ */


/* ============================================================
   CONTENEDOR PRINCIPAL
============================================================ */

.desafio-main {
    width: 100%;
    padding: 0 !important;
}

.desafio-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 4rem 2rem;
    box-sizing: border-box;
    color: #1e293b;
}


/* ============================================================
   UTILIDADES DEL DESAFÍO
============================================================ */

.desafio-screen-hidden {
    display: none !important;
}

.desafio-screen {
    width: 100%;
    animation: desafioFadeIn 0.4s ease;
}

@keyframes desafioFadeIn {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* ============================================================
   HERO / INICIO
============================================================ */

.desafio-hero {
    position: relative;
    overflow: hidden;

    max-width: 950px;
    margin: 0 auto 2.5rem auto;

    padding: 4rem 2rem;

    text-align: center;

    background:
        linear-gradient(
            135deg,
            #eff6ff 0%,
            #dbeafe 100%
        );

    border: 1.5px solid #bfdbfe;
    border-radius: 1.5rem;

    box-shadow:
        0 8px 30px rgba(30, 64, 175, 0.10);
}

.desafio-hero::before {
    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    top: -170px;
    right: -100px;

    border-radius: 50%;

    background: rgba(37, 99, 235, 0.08);
}

.desafio-hero::after {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    bottom: -130px;
    left: -80px;

    border-radius: 50%;

    background: rgba(30, 64, 175, 0.06);
}

.desafio-hero-icon {
    position: relative;
    z-index: 1;

    width: 80px;
    height: 80px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 1.25rem auto;

    font-size: 2.5rem;

    background: #ffffff;

    border: 2px solid #bfdbfe;

    border-radius: 50%;

    box-shadow:
        0 5px 18px rgba(30, 64, 175, 0.12);
}

.desafio-label,
.desafio-small-label {
    display: block;

    color: #2563eb;

    font-size: 0.78rem;
    font-weight: 800;

    letter-spacing: 0.12em;

    text-align: center;
}

.desafio-hero h1 {
    position: relative;
    z-index: 1;

    margin: 0.5rem 0 1rem 0;

    color: #1e40af;

    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;

    line-height: 1.1;
}

.desafio-hero-subtitle {
    position: relative;
    z-index: 1;

    margin: 0 0 1rem 0;

    color: #1e293b;

    font-size: 1.35rem;
    font-weight: 700;

    text-align: center !important;
}

.desafio-hero-description {
    position: relative;
    z-index: 1;

    max-width: 680px;

    margin: 0 auto 2rem auto;

    color: #475569;

    font-size: 1rem;
    line-height: 1.7;

    text-align: center !important;
}


/* ============================================================
   BOTONES
============================================================ */

.desafio-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 0.65rem;

    min-height: 48px;

    padding: 0.8rem 1.5rem;

    border: none;
    border-radius: 0.75rem;

    font-family: inherit;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.desafio-btn:hover {
    transform: translateY(-2px);
}

.desafio-btn:active {
    transform: translateY(0);
}

.desafio-btn-primary {
    background: #1e40af;
    color: #ffffff;

    box-shadow:
        0 5px 16px rgba(30, 64, 175, 0.25);
}

.desafio-btn-primary:hover {
    background: #1d4ed8;

    box-shadow:
        0 8px 22px rgba(30, 64, 175, 0.30);
}

.desafio-btn-secondary {
    background: #e5e7eb;
    color: #334155;
}

.desafio-btn-secondary:hover {
    background: #dbeafe;
    color: #1e40af;
}

.desafio-btn-arrow {
    font-size: 1.2rem;
}


/* ============================================================
   CARDS INFORMATIVAS
============================================================ */

.desafio-info-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 1.25rem;

    max-width: 1200px;

    margin: 0 auto;
}

.desafio-info-card {
    padding: 1.6rem;

    background: #ffffff;

    border: 1px solid #dbeafe;
    border-radius: 1rem;

    box-shadow:
        0 4px 18px rgba(30, 64, 175, 0.07);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.desafio-info-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 8px 25px rgba(30, 64, 175, 0.12);
}

.desafio-info-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 1rem;

    background: #eff6ff;

    border-radius: 0.8rem;

    font-size: 1.5rem;
}

.desafio-info-card h2 {
    margin: 0 0 0.6rem 0;

    color: #1e40af;

    font-size: 1.05rem;
    font-weight: 700;
}

.desafio-info-card p {
    margin: 0;

    color: #64748b;

    font-size: 0.9rem;
    line-height: 1.6;

    text-align: left !important;
}


/* ============================================================
   FORMULARIO
============================================================ */

.desafio-form-card {
    max-width: 800px;

    margin: 0 auto;

    padding: 2.5rem;

    background: #ffffff;

    border: 1px solid #dbeafe;
    border-radius: 1.25rem;

    box-shadow:
        0 8px 30px rgba(30, 64, 175, 0.08);
}

.desafio-section-heading {
    margin-bottom: 2rem;

    text-align: center;
}

.desafio-section-heading h2 {
    margin: 0.4rem 0 0.6rem 0;

    color: #1e40af;

    font-size: 2rem;
    font-weight: 800;
}

.desafio-section-heading p {
    margin: 0;

    color: #64748b;

    text-align: center !important;
}

.desafio-form-group {
    margin-bottom: 1.8rem;
}

.desafio-form-group > label,
.desafio-form-label {
    display: block;

    margin-bottom: 0.65rem;

    color: #1e293b;

    font-size: 1rem;
    font-weight: 700;

    text-align: left !important;
}

.desafio-form-group input[type="text"] {
    width: 100%;

    padding: 0.85rem 1rem;

    border: 1px solid #cbd5e1;
    border-radius: 0.7rem;

    background: #ffffff;

    color: #1e293b;

    font-family: inherit;
    font-size: 1rem;

    outline: none;

    box-sizing: border-box;

    transition:
        border 0.2s ease,
        box-shadow 0.2s ease;
}

.desafio-form-group input[type="text"]:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ============================================================
   ROLES
============================================================ */

.desafio-roles {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.8rem;
}

.desafio-role-option {
    position: relative;

    display: block;

    cursor: pointer;
}

.desafio-role-option input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.desafio-role-content {
    display: flex;

    align-items: center;

    gap: 0.8rem;

    min-height: 72px;

    padding: 0.8rem 1rem;

    background: #f8fafc;

    border: 2px solid #e2e8f0;

    border-radius: 0.8rem;

    transition:
        background 0.2s ease,
        border 0.2s ease,
        transform 0.2s ease;
}

.desafio-role-option:hover .desafio-role-content {
    border-color: #93c5fd;

    transform: translateY(-1px);
}

.desafio-role-option input:checked
+ .desafio-role-content {
    background: #eff6ff;

    border-color: #2563eb;

    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.10);
}

.desafio-role-icon {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #dbeafe;

    border-radius: 0.65rem;

    font-size: 1.3rem;
}

.desafio-role-content strong {
    display: block;

    margin-bottom: 0.15rem;

    color: #1e293b;

    font-size: 0.95rem;
}

.desafio-role-content small {
    display: block;

    color: #64748b;

    font-size: 0.75rem;
}


/* ============================================================
   ACCIONES
============================================================ */

.desafio-actions {
    display: flex;

    justify-content: center;
    align-items: center;

    flex-wrap: wrap;

    gap: 0.8rem;

    margin-top: 2rem;
}


/* ============================================================
   QUIZ
============================================================ */

.desafio-quiz-card {
    max-width: 950px;

    margin: 0 auto;

    padding: 2rem;

    background: #ffffff;

    border: 1px solid #dbeafe;

    border-radius: 1.25rem;

    box-shadow:
        0 8px 30px rgba(30, 64, 175, 0.08);
}

.desafio-quiz-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 1rem;

    margin-bottom: 1.5rem;
}

.desafio-quiz-header .desafio-small-label {
    text-align: left;
}

.desafio-question-counter {
    margin-top: 0.25rem;

    color: #334155;

    font-size: 0.95rem;
    font-weight: 700;
}

.desafio-score {
    padding: 0.55rem 1rem;

    background: #eff6ff;

    border: 1px solid #bfdbfe;

    border-radius: 999px;

    color: #1e40af;

    font-size: 0.9rem;
    font-weight: 800;

    white-space: nowrap;
}


/* ============================================================
   TEMPORIZADOR
============================================================ */

.desafio-timer-wrapper {
    margin-bottom: 2rem;
}

.desafio-timer-info {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 0.5rem;

    color: #64748b;

    font-size: 0.85rem;
}

.desafio-timer-info strong {
    color: #1e40af;
}

.desafio-timer {
    width: 100%;
    height: 12px;

    overflow: hidden;

    background: #dbeafe;

    border-radius: 999px;
}

.desafio-timer-bar {
    width: 100%;
    height: 100%;

    background: #2563eb;

    border-radius: inherit;

    transition:
        width 1s linear,
        background 0.3s ease;
}


/* ============================================================
   IMAGEN DE PREGUNTA
============================================================ */

.desafio-image-container {
    width: 100%;

    margin-bottom: 1.5rem;

    text-align: center;
}

.desafio-image-container img {
    display: block;

    width: 100%;
    max-height: 360px;

    margin: 0 auto;

    object-fit: cover;

    border-radius: 1rem;

    border: 1px solid #dbeafe;

    box-shadow:
        0 4px 15px rgba(30, 64, 175, 0.08);
}


/* ============================================================
   PREGUNTA
============================================================ */

.desafio-question-area {
    padding: 0 1rem;
}

.desafio-question-area h2 {
    margin: 0 0 1.8rem 0;

    color: #1e293b;

    font-size: clamp(1.25rem, 3vw, 1.7rem);

    line-height: 1.4;

    text-align: center !important;
}


/* ============================================================
   OPCIONES
============================================================ */

.desafio-options {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 1rem;
}

.desafio-options .opcion {
    width: 100%;

    min-height: 70px;

    padding: 1rem 1.2rem;

    background: #f8fafc;

    border: 2px solid #dbeafe;

    border-radius: 0.85rem;

    color: #1e293b;

    font-family: inherit;

    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;

    text-align: left;

    transition:
        background 0.2s ease,
        border 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.desafio-options .opcion:hover:not(:disabled) {
    background: #eff6ff;

    border-color: #60a5fa;

    transform: translateY(-2px);

    box-shadow:
        0 5px 15px rgba(30, 64, 175, 0.08);
}

.desafio-options .opcion:disabled {
    cursor: default;
}

.desafio-options .opcion.correcta {
    background: #dcfce7 !important;

    border-color: #22c55e !important;

    color: #166534 !important;
}

.desafio-options .opcion.incorrecta {
    background: #fee2e2 !important;

    border-color: #ef4444 !important;

    color: #991b1b !important;
}


/* ============================================================
   RESULTADO
============================================================ */

.desafio-result-wrapper {
    max-width: 700px;

    margin: 0 auto;
}

.desafio-result-heading {
    margin-bottom: 2rem;

    text-align: center;
}

.desafio-result-heading h2 {
    margin: 0.4rem 0;

    color: #1e40af;

    font-size: 2.2rem;
    font-weight: 800;
}

.desafio-result-heading p {
    margin: 0;

    color: #64748b;

    text-align: center !important;
}


/* ============================================================
   TARJETA DESCARGABLE
============================================================ */

.desafio-result-card {
    position: relative;

    overflow: hidden;

    width: 100%;

    padding: 2rem;

    box-sizing: border-box;

    background:
        linear-gradient(
            135deg,
            #1e40af 0%,
            #2563eb 60%,
            #1d4ed8 100%
        );

    border-radius: 1.25rem;

    color: #ffffff;

    box-shadow:
        0 12px 35px rgba(30, 64, 175, 0.25);
}

.desafio-result-card::before {
    content: "";

    position: absolute;

    width: 260px;
    height: 260px;

    top: -150px;
    right: -90px;

    background: rgba(255, 255, 255, 0.08);

    border-radius: 50%;
}

.desafio-result-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    bottom: -110px;
    left: -70px;

    background: rgba(255, 255, 255, 0.06);

    border-radius: 50%;
}

.desafio-result-brand {
    position: relative;
    z-index: 1;

    display: flex;

    align-items: center;

    gap: 0.8rem;

    padding-bottom: 1.5rem;

    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.desafio-result-trophy {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.12);

    border-radius: 0.75rem;

    font-size: 1.5rem;
}

.desafio-result-brand span {
    display: block;

    font-size: 0.65rem;
    font-weight: 700;

    letter-spacing: 0.12em;

    opacity: 0.8;
}

.desafio-result-brand strong {
    display: block;

    margin-top: 0.15rem;

    font-size: 1rem;
}

.desafio-result-main {
    position: relative;
    z-index: 1;

    padding: 1.8rem 0 1.5rem 0;

    text-align: center;
}

.desafio-result-label {
    display: block;

    margin-bottom: 0.4rem;

    font-size: 0.65rem;
    font-weight: 700;

    letter-spacing: 0.12em;

    opacity: 0.75;
}

.desafio-result-main h3 {
    margin: 0;

    font-size: 2rem;
    font-weight: 800;

    word-break: break-word;
}

.desafio-result-main p {
    margin: 0.35rem 0 0 0;

    font-size: 0.95rem;

    text-align: center !important;

    opacity: 0.85;
}

.desafio-result-stats {
    position: relative;
    z-index: 1;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 0.7rem;

    margin-bottom: 1.5rem;
}

.desafio-stat {
    padding: 0.9rem 0.5rem;

    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 0.7rem;

    text-align: center;
}

.desafio-stat strong {
    display: block;

    margin-bottom: 0.25rem;

    font-size: 1.2rem;
}

.desafio-stat span {
    display: block;

    font-size: 0.65rem;

    opacity: 0.75;

    text-transform: uppercase;
}

.desafio-result-rank {
    position: relative;
    z-index: 1;

    padding: 1rem;

    background: rgba(255, 255, 255, 0.12);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 0.8rem;

    text-align: center;
}

.desafio-result-rank span {
    display: block;

    margin-bottom: 0.3rem;

    font-size: 0.65rem;
    font-weight: 700;

    letter-spacing: 0.12em;

    opacity: 0.75;
}

.desafio-result-rank strong {
    display: block;

    font-size: 1.35rem;
}

.desafio-result-challenge {
    position: relative;
    z-index: 1;

    margin-top: 1.4rem;

    font-size: 1rem;
    font-weight: 800;

    text-align: center;
}

.desafio-result-footer {
    position: relative;
    z-index: 1;

    margin-top: 1.5rem;
    padding-top: 1rem;

    border-top: 1px solid rgba(255, 255, 255, 0.2);

    font-size: 0.7rem;

    text-align: center;

    opacity: 0.7;
}

.desafio-result-actions {
    margin-top: 1.5rem;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 1000px) {

    .desafio-info-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 768px) {

    .desafio-page {
        padding: 2rem 1rem;
    }

    .desafio-hero {
        padding: 2.5rem 1.2rem;
        border-radius: 1.1rem;
    }

    .desafio-hero-icon {
        width: 65px;
        height: 65px;

        font-size: 2rem;
    }

    .desafio-hero h1 {
        font-size: 2rem;
    }

    .desafio-hero-subtitle {
        font-size: 1.1rem;
    }

    .desafio-info-grid {
        grid-template-columns: 1fr;
    }

    .desafio-form-card,
    .desafio-quiz-card {
        padding: 1.3rem;
        border-radius: 1rem;
    }

    .desafio-section-heading h2 {
        font-size: 1.6rem;
    }

    .desafio-roles {
        grid-template-columns: 1fr;
    }

    .desafio-quiz-header {
        flex-direction: column;

        align-items: stretch;
    }

    .desafio-quiz-header .desafio-small-label {
        text-align: left;
    }

    .desafio-score {
        align-self: flex-start;
    }

    .desafio-options {
        grid-template-columns: 1fr;
    }

    .desafio-question-area {
        padding: 0;
    }

    .desafio-result-card {
        padding: 1.3rem;
        border-radius: 1rem;
    }

    .desafio-result-main h3 {
        font-size: 1.6rem;
    }

}


/* ============================================================
   MOBILE PEQUEÑO
============================================================ */

@media (max-width: 480px) {

    .desafio-page {
        padding: 1.5rem 0.75rem;
    }

    .desafio-hero {
        padding: 2rem 1rem;
    }

    .desafio-btn {
        width: 100%;
    }

    .desafio-actions {
        flex-direction: column;
    }

    .desafio-result-stats {
        gap: 0.4rem;
    }

    .desafio-stat {
        padding: 0.7rem 0.25rem;
    }

    .desafio-stat strong {
        font-size: 1rem;
    }

    .desafio-stat span {
        font-size: 0.55rem;
    }

}