html,body{
    overflow:hidden;
}

.formScreen {
    position: fixed;
    top: 150px;
    bottom: 6%;
    left: 10%;
    width: 80%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 25px;
}

.implicitSubmit {
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Panels */

.tocPanel {
    width: 31%;
    flex-shrink: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.stepPanel {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.panelHeader {
    height: 70px;
    flex-shrink: 0;
    padding: 0 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f2f2f2;
    border-radius: 16px;
    box-shadow: 0px 7px 0px #9dc8aa;
    position: relative;
    z-index: 2;
}

.panelHeader h2 {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.5em;
    color: #004930;
    font-weight: 500;
    margin: unset;
}

.panelBody {
    margin: -16px 10px 0;
    padding-top: 16px;
    background-color: #ffffff;
    border-radius: 0 0 16px 16px;
    overflow-y: auto;
}

/* Table of contents */

.tocPanel .panelBody {
    padding-top: 41px;
    padding-bottom: 25px;
}

.tocItem {
    display: block;
    width: 100%;
    padding: 10px 40px;
    box-sizing: border-box;
    text-align: left;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.4em;
    color: #004930;
    font-weight: 400;
    transition: background-color 0.2s ease;
}

.tocItem:hover,
.tocItem.active {
    background-color: #f2f2f2;
}

.tocItem.active {
    font-weight: 700;
}

/* Answered / total questions of the step */
.tocCount {
    margin-left: 4px;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.65;
    white-space: nowrap;
}

.tocCount.complete {
    font-weight: 700;
    opacity: 1;
    color: #009960;
}

/* Back / next */

.stepNav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 60px;
}

.stepNav button {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: unset;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.5em;
    color: #004930;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.stepNav button:hover {
    transform: scale(1.05);
}

.stepNav svg {
    width: 40px;
    height: 40px;
}

/* Questions */

.stepPanel .panelBody {
    flex: 1;
    padding: 66px 30px 50px;
    box-sizing: border-box;
}

.stepFields {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field label {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.05em;
    color: #004930;
    font-weight: 700;
    text-transform: uppercase;
    padding-left: 22px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 22px;
    background-color: #f2f2f2;
    border: 2px solid #f2f2f2;
    border-radius: 30px;
    outline: none;
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.1em;
    color: #004930;
    font-weight: 600;
    transition: border-color 0.2s ease;
}

.field textarea {
    border-radius: 16px;
    resize: vertical;
}

.field select {
    appearance: none;
    cursor: pointer;
    padding-right: 50px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' style='fill:none;stroke:%23004930;stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 22px center;
    background-size: 16px 10px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #004930;
}

/* Image picker (media questions) */

.imagePicker {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
}

.imagePreview {
    width: 430px;
    max-width: 60%;
    height: 150px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f2f2;
    border-radius: 30px;
    overflow: hidden;
}

.imagePreview img,
.imagePreview svg {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
}

.imagePreview p {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.1em;
    color: #004930;
    font-weight: 400;
    margin: unset;
    opacity: 0.6;
}

.imagePickerActions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.imagePickerActions button {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.1em;
    color: #004930;
    font-weight: 700;
    background-color: #f2f2f2;
    border: none;
    border-radius: 16px;
    padding: 10px 22px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.imagePickerActions button:hover {
    transform: scale(1.05);
}

.imagePickerActions button[hidden] {
    display: none;
}

/* Autofill (js/autofill/): "Buscar datos" on the company name, hints, status and ticks */

.field {
    position: relative;
}

.autofillRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.autofillRow input {
    flex: 1;
    min-width: 0;
}

.autofillButton {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: unset;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.1em;
    color: #004930;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.autofillButton:hover:not(:disabled) {
    transform: scale(1.05);
}

.autofillButton:disabled {
    cursor: default;
    opacity: 0.4;
}

.autofillButton svg {
    width: 40px;
    height: 40px;
}

.autofillHint,
.autofillStatus {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 0.95em;
    color: #004930;
    font-weight: 400;
    margin: unset;
    padding-left: 22px;
}

.autofillHint {
    opacity: 0.65;
}

.autofillStatus {
    font-weight: 600;
}

.autofillStatus[hidden] {
    display: none;
}

/* Tick on the label line, right-aligned */
.autofillTick {
    position: absolute;
    top: 0;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 0.9em;
    color: #009960;
    font-weight: 600;
}

.autofillTick svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.field.autofilled label {
    padding-right: 280px;
}

.emptyStep {
    font-family: 'Source Sans 3';
    text-decoration: unset;
    font-size: 1.2em;
    color: #004930;
    font-weight: 400;
    text-align: center;
    margin: unset;
    opacity: 0.6;
}

/* Responsive */

/* Short screens: keep the panels clear of the fixed header */
@media (max-height: 650px) {
    .formScreen {
        top: 110px;
        bottom: 16px;
    }
}

@media (max-width: 1200px) {
    .stepNav {
        gap: 30px;
    }

    .panelHeader h2,
    .stepNav button {
        font-size: 1.3em;
    }

    .tocItem {
        font-size: 1.2em;
        padding: 10px 30px;
    }
}

@media (max-width: 1024px) {
    .formScreen {
        left: 5%;
        width: 90%;
        gap: 16px;
    }

    .tocPanel {
        width: 30%;
    }

    .panelHeader {
        padding: 0 20px;
    }

    .panelHeader h2,
    .stepNav button {
        font-size: 1.15em;
    }

    .stepNav {
        gap: 20px;
    }

    .stepNav svg {
        width: 34px;
        height: 34px;
    }

    .tocItem {
        font-size: 1.05em;
        padding: 10px 20px;
    }

    .stepPanel .panelBody {
        padding: 50px 24px 40px;
    }

    .imagePicker {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .imagePreview {
        width: 100%;
        max-width: none;
    }

    .imagePickerActions {
        flex-direction: row;
    }
}

/* Mobile: panels stack; the table of contents becomes a horizontal, scrollable row of steps */
@media (max-width: 768px) {
    .formScreen {
        top: 110px;
        bottom: 16px;
        left: 16px;
        width: calc(100% - 32px);
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .tocPanel {
        width: 100%;
        flex-shrink: 0;
    }

    .tocPanel .panelHeader {
        display: none;
    }

    .tocPanel .panelBody {
        margin: 0;
        padding: 8px;
        border-radius: 16px;
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .tocItem {
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 16px;
        border-radius: 16px;
        font-size: 1em;
    }

    .stepPanel {
        flex: 1;
        min-height: 0;
        height: auto;
    }

    .panelHeader {
        height: 60px;
        padding: 0 16px;
        gap: 12px;
    }

    .panelHeader h2 {
        font-size: 1.1em;
    }

    .stepNav {
        gap: 16px;
        flex-shrink: 0;
    }

    .stepNav button {
        font-size: 1.05em;
        gap: 8px;
    }

    .stepNav svg {
        width: 30px;
        height: 30px;
    }

    .stepPanel .panelBody {
        padding: 40px 16px 30px;
    }

    .stepFields {
        gap: 22px;
    }

    .field label {
        font-size: 0.95em;
        padding-left: 16px;
    }

    .field input,
    .field select,
    .field textarea {
        padding: 12px 16px;
        font-size: 1em;
    }

    .field select {
        background-position: right 16px center;
        padding-right: 44px;
    }

    .imagePreview {
        height: 120px;
        border-radius: 16px;
    }

    /* Tick: icon only (the text stays as its tooltip and for screen readers) */
    .autofillTick {
        right: 16px;
    }

    .autofillTick span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .field.autofilled label {
        padding-right: 40px;
    }

    .autofillHint,
    .autofillStatus {
        padding-left: 16px;
    }

    .autofillButton span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .autofillButton svg {
        width: 34px;
        height: 34px;
    }

    .imagePickerActions {
        justify-content: center;
    }
}

/* Small phones: Atrás / Siguiente show only their arrows (text kept for screen readers) */
@media (max-width: 480px) {
    .stepNav span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .stepNav {
        gap: 10px;
    }

    .imagePickerActions button {
        font-size: 1em;
    }
}
