/* =========================================================
   Access pages of producers and buyers (usuarios/): login with the profile selector (COM-01, PRO-01)
   and registration request (COM-06 / PRO-02). Figma «00.LOG IN» on phones and, from 768px, the
   generic desktop login «00. LOGIN» (1563-3107) and «02. REGISTRO» (1563-3273): header, white card
   and funding logos. Fields, buttons and radio buttons: shared/css/mobile.css.
   ========================================================= */

/* 33px between header, form and logos in Figma, rounded to the 8px grid. */
.access-page {
    gap: var(--token-space-8);
}

/* Logo on the left and the language selector on the right. */
.access-page__header {
    height: 60px;
    background-color: var(--background-main-header);
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.access-page__logo {
    width: 63px;
    height: 55px;
    object-fit: cover;
}

.access-page__main {
    padding: 0 var(--token-space-3);
    display: flex;
    flex: 1;
    justify-content: center;
}

.access-page__form {
    width: 327px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--token-space-8);
}

.access-page__title {
    font-size: var(--token-font-size-h1);
    font-weight: var(--token-font-weight-bold);
    letter-spacing: -0.96px;
    text-align: center;
}

.access-page__profiles {
    display: flex;
    gap: var(--token-space-5);
}

/* 95px between the tops of the two fields in Figma (field 73px + 22px), rounded to 24px. */
.access-page__fields {
    display: flex;
    flex-direction: column;
    gap: var(--token-space-6);
}

.access-page__forgot {
    font-size: var(--token-font-size-s);
    font-weight: var(--token-font-weight-medium);
    line-height: 21px;
    color: var(--font-color-link-mobile);
    text-align: right;
    text-decoration: underline;
}

.access-page__actions {
    display: flex;
    flex-direction: column;
    gap: var(--token-space-2);
}

.access-page__register {
    padding: var(--token-space-4) 0;
    display: flex;
    flex-direction: column;
    gap: var(--token-space-3);
}

.access-page__register-title {
    font-size: 16px;
    font-weight: var(--token-font-weight-bold);
    line-height: 1.25;
    color: var(--font-color-mobile-heading);
    text-align: center;
}

/* =========================================================
   Funding logos: one 583 x 72 image, split in two rows on phones (360px + 223px), whole from 640px
   ========================================================= */

.access-page__footer {
    padding-bottom: var(--token-space-3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Below 360px both rows scale down together instead of cropping the logos: the height follows the
   width (aspect-ratio) and the image fills that height. */
.access-page__logos {
    overflow: hidden;
}

.access-page__logos img {
    width: auto;
    max-width: none;
    height: 100%;
}

.access-page__logos--first {
    width: min(360px, 100%);
    aspect-ratio: 360 / 72;
}

/* Same scale as the first row: 222 / 360 of the width it takes. */
.access-page__logos--second {
    width: min(222px, 61.67%);
    aspect-ratio: 222 / 72;
}

/* Starts where the first row ends: 360 / 222 of its own width. */
.access-page__logos--second img {
    margin-left: -162.16%;
}

@media (min-width: 640px) {
    .access-page__logos--first {
        width: 583px;
        aspect-ratio: 583 / 72;
    }

    .access-page__logos--second {
        display: none;
    }
}

/* =========================================================
   Desktop (from 768px), Figma «00. LOGIN» (1563-3107): grey page with a 448px white card between
   the black header and the white footer, 88px apart. Fields of 40px, 14px labels and 48px buttons.
   ========================================================= */

@media (min-width: 768px) {
    .access-page {
        color: var(--font-color-login);
        background-color: var(--background-page);
        gap: 0;
    }

    /* Header */

    .access-page__header {
        height: auto;
        padding: var(--token-space-8) var(--token-space-3);
        justify-content: center;
        position: relative;
    }

    /* The logo stays centred: the language selector goes to the right corner, out of the flow. */
    .access-page__header > language-switch {
        position: absolute;
        top: 50%;
        right: var(--token-space-6);
        transform: translateY(-50%);
    }

    /* Same logo and size as the admin login (shared/css/login.css). */
    .access-page__logo {
        width: 104px;
        height: 90px;
    }

    /* Card */

    .access-page__main {
        padding: 88px var(--token-space-3);
        align-items: flex-start;
    }

    /* 448px card with the 327px column centred: (448 - 327) / 2 ≈ 60px at each side. */
    .access-page__form {
        width: 448px;
        background-color: var(--background-form);
        border-radius: var(--token-radius-s);
        padding: var(--token-space-5) 60px;
    }

    .access-page__title {
        color: var(--font-color-login);
    }

    /* 30px between the fields in Figma, rounded to the 8px grid as in the admin login. */
    .access-page__fields {
        gap: var(--token-space-8);
    }

    .access-page .mobile-field {
        gap: var(--token-space-1);
    }

    .access-page .mobile-field__label,
    .access-page .mobile-choices > legend {
        font-size: var(--token-font-size-s);
        line-height: 21px;
    }

    .access-page .input--large {
        font-size: var(--token-font-size-s);
        height: 40px;
        padding: 0 var(--token-space-2);
    }

    /* Profile selector: 16px radio buttons and 14px labels, as «¿Cómo le interesaría registrarse?». */
    .access-page .radio--large,
    .access-page .checkbox--large {
        font-size: var(--token-font-size-s);
        color: var(--font-color-login);
    }

    .access-page .radio--large .radio__input {
        width: 16px;
        height: 16px;
    }

    .access-page .radio--large .radio__input:checked {
        background-image: url("../assets/icons/icon-radio-checked-black.svg");
        background-size: 17px 17px;
    }

    /* «Recuérdame»: 20px checkbox. */
    .access-page .checkbox--large .checkbox__input {
        width: 20px;
        height: 20px;
    }

    .access-page .checkbox--large .checkbox__input:checked {
        background-image: url("../assets/icons/icon-checkbox-checked-medium.svg");
        background-size: 20px 20px;
    }

    .access-page .button--large {
        height: 48px;
    }

    /* The desktop login has no line between «Recuérdame» and the button. */
    .access-page__divider--mobile {
        display: none;
    }

    .access-page__register {
        padding: 0;
    }

    /* Footer: white band with the 667 x 82px logos. */

    .access-page__footer {
        background-color: var(--background-login-footer);
        padding: var(--token-space-3);
    }

    .access-page__logos--first {
        width: 667px;
        aspect-ratio: 667 / 82;
    }
}

/* Short desktop windows (laptops): compact header, as the admin login. */
@media (min-width: 768px) and (max-height: 800px) {
    .access-page__header {
        padding: var(--token-space-3);
    }

    .access-page__logo {
        width: 81px;
        height: 70px;
    }
}
