
/* ==================================
  MODAL FORMS
================================== */

.modal_form_signin, .modal_form_signup {
    padding-top: 0.5rem;
    width: 100%;

    .buttons {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        padding: 2rem 0.3rem 1.5rem;
    }
    .cmodal_button:disabled {
        height: 52px;
        min-width: 180px;
        background: #EEE url('../images/loading-buttons.gif') center no-repeat;
        background-size: 25px 25px;
        border-color: #EEE;
        cursor: not-allowed;
        transform: unset;
        filter: unset;
        transition: unset;
        color: transparent;
        text-align: center;
        text-shadow: unset;
    }
    .app_forms {
        .fieldset {
            margin-bottom: 0;
        }
        .switch-onoff {
            &, span {
                text-align: left;
            }
        }
    }
    .app_forms-errors {
        padding: 0;
        border: 0;
        background-color: transparent;
        border-radius: 0;

        &:not(:empty) {
            margin-top: 2rem;
            padding: 0.6rem 0.7rem;
            border: solid 2px var(--color-errors);
            background-color: var(--color-errors-ele);
            border-radius: 0.5rem;
            font-size: 0.8rem;
            line-height: 1.2;
            text-align: left;

            &::before {
                content: 'ERROR: ';
                color: var(--color-errors);
                font-weight: 700;
            }
        }
    }
    @media (max-width: 540px) {
        .app_forms {
            .row,
            .row.columns,
            .row.columns .row {
                display: block;
                margin-bottom: 0.5rem;
            }
        }
        .buttons {
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
        }
        .cmodal_button {
            width: 200px;
        }
    }
}
.modal_form_signup {
    .step {
        display: none;
        margin-bottom: 0;

        &.visible {
            display: block;
        }
    }
    .step-markers {
        width: 100%;
        margin-bottom: 1rem;

        &, p, button {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        p, button {
            width: 35px;
            height: 35px;
            margin: 0;
            padding: 0;
            border: solid 3px var(--color-green-30);
            background-color: white;
            border-radius: 35px;
            font-family: var(--font-display);
            font-size: 0.9rem;
            line-height: 1;
            color: var(--color-green-60);
            font-weight: 600;

            &.active {
                border-color: var(--color-green-60);
                background-color: var(--color-green-60);
                color: white;
            }
            &.current {
                border-color: var(--color-green-80);
                background-color: var(--color-green-80);
                color: white;
            }
        }
        span {
            display: inline-block;
        }
        hr {
            display: inline-block;
            width: 8px;
            border-bottom: solid 1px var(--color-green-30);
        }
    }
}

/* ==================================
  LANDING BASICS
================================== */

.page_header,
.page_header-content {
    height: 130px;
}
.page_header {
    position: sticky;
    top: 0;
    left: 0;
    flex-shrink: 0;
    background-color: var(--color-green-30);
    z-index: 99;
}
.page_header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.page_header-logo {
    display: block;
    width: 385px;

    &:focus {
        outline: dashed 2px var(--color-focus);
        outline-offset: 6px;
        border-radius: 0.3rem;
    }

    img, svg {
        width: 100%;
        height: auto;
    }
}
.page_header-nav {
    display: inline-block;
}
.page_header-nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: var(--color-green-15);
    border-radius: 1rem;
    overflow: hidden;

    a {
        display: inline-block;
        padding: 0.4rem 0.4rem;
        font-size: 0.9rem;
        color: var(--color-green-100);
        text-decoration: none;
        font-weight: 500;

        &:hover {
            background-color: var(--color-green-60);
            color: white;
        }
        &:active, &.active {
            background-color: var(--color-green-80);
            color: white;
        }
        &:focus {
            text-decoration: underline;
        }
    }
    li {
        &:first-child a {
            padding-left: 0.7rem;
            border-top-left-radius: 1rem;
            border-bottom-left-radius: 1rem;
        }
        &:last-child a {
            padding-right: 0.7rem;
            border-top-right-radius: 1rem;
            border-bottom-right-radius: 1rem;
        }
    }
}
.mobile_mainnav-switchbtn {
    display: none;
    width: 45px;
    height: 50px;
    background-color: transparent;
    cursor: pointer;

    & .cloud-btn-path {
        fill: var(--color-green-60);
    }
    & .cloud-btn-background {
        fill: var(--color-green-15);
    }
    &:active {
        & .cloud-btn-path {
            fill: white;
        }
        & .cloud-btn-background {
            fill: var(--color-green-80);
        }
    }
}
.page_header-user-actions {
    position: absolute;
    display: block;
    width: 100%;

    .buttons {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        width: fit-content;
        margin-left: auto;
        margin-top: -1.5rem;
    }
    button {
        display: inline-block;
        padding: 0.6rem 1.1rem;
        border: solid 3px var(--color-green-80);
        border-radius: 2rem;
        cursor: pointer;
        font-family: var(--font-display);
        font-size: 1.1rem;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: -1px;

        &.signup {
            background-color: var(--color-green-80);
            color: white;
        }
        &.signin {
            background-color: var(--color-green-15);
            color: var(--color-green-80);
        }
        &.signup:active {
            background-color: var(--color-green-15);
            color: var(--color-green-80);
        }
        &.signin:active {
            background-color: var(--color-green-80);
            color: white;
        }
    }
}
@media (max-width: 890px) {
    .page_header-nav-links,
    .page_header-user-actions {
        display: none;
    }
    .mobile_mainnav-switchbtn {
        display: block;
    }
}
@media (max-width: 520px) {
    .page_header,
    .page_header-content {
        height: 90px;
    }
    .page_header-logo {
        max-width: 250px;
    }
}
@media (max-width: 360px) {
    .page_header-logo {
        max-width: 190px;
    }
}

.mobile_mainnav {
    position: fixed;
    overflow: hidden;
    z-index: 130;
    transition: all 0.4s ease-out;
    display: none;

    &, .overlay, .maincontent {
        left: 0;
        top: 0;
    }
    &, .overlay {
        height: 100vh;
        width: 100vw;
    }
    .overlay, .maincontent {
        position: absolute;
    }

    .overlay {
        background-color: rgba(0,0,0,0.4);
        cursor: pointer;
    }
    .maincontent {
        left: 50%;
        transform: translateX(-50%);
        width: fit-content;
    }
    .mainnav {
        display: block;
        width: 250px;
        padding: 1.5rem 2rem;
        background-color: white;
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
        transition: all 0.4s ease-out;
        text-align: center;
    }
    .links {
        &, li {
            display: block;
            width: 100%;
        }
    }
    .link {
        display: block;
        width: 100%;
        padding: 7px 0;
        background-color: white;
        border-radius: 2rem;
        font-family: var(--font-sans);
        font-size: 1rem;
        line-height: 1;
        color: var(--color-green-80);
        text-decoration: underline;
        font-weight: 600;

        &:focus {
            background-color: var(--color-green-15);
            text-decoration: none;
            outline: dashed 2px var(--color-focus);
            outline-offset: 2px;
        }

        &.btn-signup, &.btn-signin {
            padding: 10px 0;
            text-decoration: none;
            font-family: var(--font-display);
            line-height: 1.1;
            font-weight: 800;
            text-transform: uppercase;
        }
        &.btn-signup {
            margin-top: 20px;
            background-color: var(--color-green-80);
            color: white;
            text-shadow: 1px 2px 2px var(--color-green-100);
        }
        &.btn-signin {
            margin-top: 5px;
            background-color: var(--color-green-60);
            color: white;
            text-shadow: 1px 2px 2px var(--color-green-100);
        }

        &:active, &.active {
            background-color: var(--color-green-15);
            color: black;
            text-decoration: none;
        }
    }
    .btn-close {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 2rem;
        height: 2rem;
        margin: 1.5rem auto 0;
        background-color: white;
        border: solid 2px var(--color-green-30);
        border-radius: 3rem;

        svg {
            display: block;
            width: 13px;
            height: 13px;
        }
        path {
            fill: var(--color-green-30);
        }

        &:active {
            border-color: var(--color-green-80);
            background-color: var(--color-green-80);
            transform: scale(1.2);

            path {
                fill: white;
            }
        }
    }
}

.page_footer,
.page_footer-content {
    height: 100px;
}
.page_footer {
    flex-shrink: 0;
    background-color: var(--color-green-30);
}
.page_footer-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.page_footer-logo {
    display: block;
    max-width: 200px;

    &:focus {
        outline: dashed 2px var(--color-focus);
        outline-offset: 6px;
        border-radius: 0.3rem;
    }

    & img {
        width: 100%;
        height: auto;
    }
}
.page_footer-nav {
    display: inline-block;
}
.page_footer-nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: var(--color-green-15);
    border-radius: 1rem;
    overflow: hidden;
    
    a {
        display: inline-block;
        padding: 0.4rem 0.4rem;
        font-size: 0.9rem;
        text-decoration: none;
        font-weight: 500;

        &:link {
            color: var(--color-green-100);
        }
        &:hover {
            background-color: var(--color-green-60);
            color: white;
        }
        &:active, &.active {
            background-color: var(--color-green-80);
            color: white;
        }
        &:focus {
            text-decoration: underline;
        }
    }
    li {
        &:first-child a {
            padding-left: 0.7rem;
            border-top-left-radius: 1rem;
            border-bottom-left-radius: 1rem;
        }
        &:last-child a {
            padding-right: 0.7rem;
            border-top-right-radius: 1rem;
            border-bottom-right-radius: 1rem;
        }
    }
}
.page_footer-credits {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    text-align: right;
}
@media (max-width: 735px) {
    .page_footer {
        margin-top: 4rem;
    }
}
@media (max-width: 680px) {
    .page_footer,
    .page_footer-content {
        height: auto;
        padding: 1rem 0;
    }
    .page_footer-content {
        display: block;
        text-align: center;
    }
    .page_footer-logo {
        margin: 0 auto 2rem;
    }
    .page_footer-credits {
        margin-top: 0.8rem;
        text-align: center;
    }
}
@media (max-width: 460px) {
    .page_footer-nav-links {
        flex-wrap: wrap;
        justify-content: center;
        background-color: transparent;
        gap: 0.5rem 0.3rem;
        overflow: inherit;
        
        a {
            background-color: var(--color-green-15);
        }
        li {
            &:last-child {
                margin-bottom: 0;
            }
            &:first-child a, &:last-child a, a {
                padding: 0.4rem 1rem;
                border-radius: 2rem;
            }
        }
    }
}

.page_title {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--color-green-80);
    letter-spacing: -1px;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 10px;
    background-color: black;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
    font-size: 14px;

    &:focus {
        top: 10px;
        outline: dashed 1px black !important;
        outline-offset: 4px;
    }
    &:hover {
        color: white;
        background-color: #444;
    }
}

/* ==================================
  HOME
================================== */

.page_home-content {
    display: flex;
    flex-direction: row;
    gap: 6rem;
    margin: 5rem 0;
    background: url("../images/cloud-content-home.webp") top center no-repeat;
    background-size: 100% auto;

    .product-package {
        img {
            display: inline-block;
            margin-top: 8rem;
            transform: rotate(-12deg);
        }
    }
    .cookies, .dulcemillon-logo {
        display: block;
    }
    .cookies {
        margin: 4rem auto 1rem;
    }
    .dulcemillon-logo {
        margin-bottom: 1.2rem;
    }
    .contest-message {
        padding-right: 10%;
        line-height: 1.6;

        &, .button-link {
            font-family: var(--font-sans);
            font-size: 1.1rem;
        }
        .button-link {
            padding: 0;
            background-color: transparent;
            cursor: pointer;
            border-radius: 0.3rem;
            line-height: 1;
            color: var(--color-green-100);
            text-decoration: underline;

            &:hover, &:active {
                color: var(--color-green-60);
                text-decoration: none;
            }
        }
    }
    .button-signup {
        display: inline-block;
        margin-top: 3rem;
        padding: 1.1rem 1.6rem;
        border-radius: 3rem;
        background-color: var(--color-green-80);
        cursor: pointer;
        font-family: var(--font-display);
        font-size: 1.7rem;
        line-height: 1;
        color: white;
        text-transform: uppercase;
        text-decoration: none;
        font-weight: 600;
        letter-spacing: -1px;
        text-shadow: 1px 3px 2px var(--color-green-100);

        &:active {
            background-color: var(--color-green-15);
            color: var(--color-green-100);
            text-shadow: unset;
        }
    }
}
@media (max-width: 1040px) {
    .page_home-content {
        gap: 4rem;

        .dulcemillon-logo {
            width: 420px;
            height: auto;
        }
        .product-package {
            img {
                width: 280px;
                height: auto;
            }
        }
    }
}
@media (max-width: 840px) {
    .page_home-content {
        .cookies {
            display: none;
        }
        .dulcemillon-logo {
            width: 320px;
            height: auto;
            margin-top: 7rem;
        }
    }
}
@media (max-width: 740px) {
    .page_home-content {
        gap: 1rem;
        margin: 2rem 0;

        .product-package {
            order: 2;
            margin-top: -3rem;
            img {
                width: 260px;
                height: auto;
                transform: rotate(12deg);
            }
        }
        .contest-info {
            order: 1;
        }
        .button-signup {
            margin-top: 2rem;
        }
    }
}
@media (max-width: 560px) {
    .page_home-content {
        margin-top: 6rem;
        display: block;
        text-align: center;

        .dulcemillon-logo {
            margin: 2rem auto 1rem;
        }
        .contest-message {
            padding-right: 0;
            font-size: 1rem;
            line-height: 1.5;
        }
        .product-package {
            img {
                width: 165px;
                height: auto;
                margin-top: 0;
                padding-top: 0;
            }
        }
        .button-signup {
            margin-top: 1.7rem;
            font-size: 1.4rem;
        }
    }
}
@media (max-width: 420px) {
    .page_home-content {
        .dulcemillon-logo {
            width: 100%;
        }
    }
}

/* ==================================
  QUESTIONS AND ANSWERS
================================== */

.page_fqa-content {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    margin: 5rem 0;
    width: 100%;
    min-height: 500px;
    background: url("../images/cloud-content-home.webp") top center no-repeat;
    background-size: 100% auto;

    .product-package {
        img {
            width: 250px;
            height: auto;
            transform: rotate(10deg);
        }
    }
    .contest-info {
        width: 100%;
    }
    .page_title {
        margin-top: 3rem;
    }

    .faq-container,
    .fqa-row, .question {
        display: block;
    }
    .faq-container {
        display: block;
        width: 100%;
        margin-top: 1.5rem;
    }
    .fqa-row {
        margin-bottom: 1rem;
        background-color: transparent;

        &:last-child {
            margin-bottom: 0;
        }
    }
    .question {
        padding: 0.8rem 1.3rem;
        cursor: pointer;
        border: solid 2px var(--color-green-30);
        background-color: rgba(255,255,255,0.5);
        border-radius: 2rem;
        font-family: var(--font-display);
        font-size: 1.2rem;
        line-height: 1.2;
        color: var(--color-green-80);
        font-weight: 600;
    }
    .question:hover, .question:active {
        border-color: var(--color-green-60);
    }
    .fqa-row[open] .question {
        background-color: var(--color-green-30);
        color: black;
    }
    .question::marker {
        color: transparent;
    }
    /* Enfoque para navegación por teclado */
    /*.question:focus {
        outline: dashed 2px var(--color-green-60);
        outline-offset: 2px;
    }*/
    .answer {
        padding: 0.8rem 1.3rem;
        font-size: 1.1rem;
        line-height: 1.6;
        animation: slideDown 0.4s ease-out;
    }
    .answer p {
        margin: 10px 0;
    }
    .answer p:first-child {
        margin-top: 0;
    }
    .answer p:last-child {
        margin-bottom: 0;
    }

    /* Reducir animaciones para usuarios sensibles */
    @media (prefers-reduced-motion: media) {
        .question {
            transition: none;
        }
    }
    /* Aumentar contraste en modo alto contraste */
    @media (prefers-contrast: more) {
        .question {
            font-weight: 700;
        }

        details[open] .question {
            background-color: #003d99;
            color: #ffffff;
        }
    }
}
@media (max-width: 1040px) {
    .page_fqa-content {
        .question {
            border-radius: 1rem;
        }
    }
}
@media (max-width: 880px) {
    .page_fqa-content {
        display: block;

        .product-package {
            text-align: center;
            img {
                margin-top: 2rem;
                width: 170px;
                height: auto;
                transform: rotate(-6deg);
            }
        }
        .page_title {
            text-align: center;
        }
    }
}

/* ==================================
  TERMS
================================== */

.page_terms-content {
    margin: 5rem 0;
    width: 100%;

    & .rules {
        display: block;
    }
    .rules {
        margin-top: 1.5rem;
        counter-reset: rule-count;

        li {
            position: relative;
            padding-left: 2.5rem;
            margin-bottom: 1.5rem;
            counter-increment: rule-count;

            &::before {
                position: absolute;
                left: 0;
                top: 0;
                display: inline-block;
                content: counter(rule-count,decimal-leading-zero);
                font-family: var(--font-display);
                font-size: 1.4rem;
                line-height: 1.5;
                color: var(--color-green-80);
                font-weight: 600;
            }

            p {
                margin-bottom: 0.7rem;
                font-size: 1.1rem;
                line-height: 1.6;
            }
        }
    }
}

/* ==================================
  MY CODES
================================== */

.page_mycodes-content {
    display: flex;
    flex-direction: row;
    gap: 6rem;
    width: 100%;
    margin: 5rem 0;

    .block-form, .block-codes {
        width: 100%;
    }
    .info {
        margin-top: 1rem;
        font-size: 1.1rem;
        line-height: 1.6;
    }
    .dulcemillon-logo {
        display: block;
        width: 385px;
        height: auto;
        margin-top: 1.4rem;
    }
    .cookies {
        margin-left: 1rem;
        width: 142px;
        height: auto;
    }
    .page_title {
        margin-top: -0.8rem;
        font-size: 2.4rem;
    }
    .code-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem 0.6rem;
        margin-top: 1rem;

        &:empty::before {
            display: block;
            content: 'No tienes códigos registrados.';
            font-size: 1rem;
            line-height: 1.1;
            color: #999;
        }

        li {
            display: flex;
            flex-direction: row;
            align-items: center;
            padding: 0.7rem 0 0.7rem 2.4rem;
            width: 100%;
            background: var(--color-green-15) url('../images/cookie-small.webp') 15px center no-repeat;
            background-size: 15px 15px;
            border-radius: 2rem;

            &:hover {
                background-color: var(--color-green-30);
                background-size: 20px 20px;
                background-position: 12px center;

                &, .code, .date {
                    color: var(--color-green-100);
                }
            }

            &.new-code {
                background-color: var(--color-green-80);
                background-size: 20px 20px;
                background-position: 12px center;

                &, &:hover {
                    &, .code, .date {
                        color: white;
                    }
                }
            }
        }
        .code, .date {
            line-height: 1;
        }
        .code {
            margin-right: 0.8rem;
            font-family: var(--font-display);
            font-size: 1.2rem;
            font-weight: 600;
        }
        .date {
            font-size: 0.8rem;
        }
    }
    .form-addcode {
        display: block;
        margin-top: 2rem;

        .inputs {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: space-between;
            gap: 0.3rem;
            width: 100%;
            max-width: 480px;
        }
        .button-addcode {
            display: inline-block;
            margin-top: 1rem;
            padding: 0.8rem 1.6rem;
            border-radius: 2rem;
            background-color: var(--color-green-80);
            cursor: pointer;
            font-family: var(--font-display);
            font-size: 1.5rem;
            color: white;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: -1px;
            text-shadow: 1px 3px 2px var(--color-green-100);

            &:active {
                background-color: var(--color-green-15);
                color: var(--color-green-100);
                text-shadow: unset;
            }
            &:disabled {
                height: 52px;
                min-width: 245px;
                background: #EEE url('../images/loading-buttons.gif') center no-repeat;
                background-size: 25px 25px;
                cursor: not-allowed;
                transform: unset;
                filter: unset;
                transition: unset;
                color: transparent;
                text-align: center;
                text-shadow: unset;
            }
        }

        .code-char::-webkit-inner-spin-button,
        .code-char::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .code-char {
            display: inline-block;
            width: 100%;
            height: 75px;
            background-color: var(--color-green-15);
            border-radius: 1rem;
            -moz-appearance: textfield;
            appearance: textfield;
            font-family: var(--font-display);
            font-size: 2rem;
            line-height: 1;
            color: black;
            font-weight: 600;
            text-align: center;

            &:hover, &:focus {
                background-color: var(--color-green-30);
            }
        }
    }

    @media (max-width: 1080px) {
        .code-list {
            grid-template-columns: 1fr;
        }
    }
    @media (max-width: 840px) {
        & {
            display: block;
        }
        .block-codes {
            margin-top: 6rem;
        }
    }
    @media (max-width: 520px) {
        .form-addcode {
            .code-char {
                height: 60px;
                border-radius: 0.7rem;
                font-size: 1.6rem;
            }
            .button-addcode  {
                font-size: 1.3rem;
            }
        }
    }
    @media (max-width: 440px) {
        .dulcemillon-logo {
            width: 100%;
        }
        .page_title {
            font-size: 2.1rem;
        }
    }
}

/* ==================================
  MY PROFILE
================================== */

.page_myprofile-content {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    width: 100%;
    margin: 5rem 0;

    .block-account, .block-demographic {
        display: block;
        width: 100%;
    }
    .page_title {
        margin-bottom: 1.5rem;
        font-size: 2rem;
    }
    .buttons {
        margin-top: 3rem;
    }
    .form-button {
        display: inline-block;
        padding: 0.8rem 1.6rem;
        border-radius: 2rem;
        background-color: var(--color-green-80);
        cursor: pointer;
        font-family: var(--font-display);
        font-size: 1.5rem;
        color: white;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: -1px;
        text-shadow: 1px 3px 2px var(--color-green-100);

        &:active {
            background-color: var(--color-green-15);
            color: var(--color-green-100);
            text-shadow: unset;
        }
        &:disabled {
            height: 52px;
            min-width: 245px;
            background: #EEE url('../images/loading-buttons.gif') center no-repeat;
            background-size: 25px 25px;
            cursor: not-allowed;
            transform: unset;
            filter: unset;
            transition: unset;
            color: transparent;
            text-align: center;
            text-shadow: unset;
        }
    }

    @media (max-width: 920px) {
        & {
            gap: 2rem;
        }
        .page_title {
            font-size: 1.6rem;
        }
        .row,
        .row.columns,
        .row.columns .row {
            display: block;
            margin-bottom: 0.5rem;
        }
    }
    @media (max-width: 680px) {
        & {
            flex-direction: column;
        }
    }
}
