@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap");

:root {
    --color-header: #00418D;
    --color-accent: #F49811;
    --color-text: #FFFFFF;
    --font-main: "Montserrat", Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-header);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-header);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.topbar {
    height: 146px;
    flex: 0 0 146px;
    background: var(--color-header);
}

.topbar__inner {
    width: 100%;
    height: 146px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 56px 0 54px;
}

.topbar__logo {
    display: inline-flex;
    align-self: flex-start;
}

.topbar__logo img {
    width: 146px;
    height: 146px;
    object-fit: contain;
}

.topbar__contact {
    color: var(--color-accent);
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.page-shell {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 222px);
    padding: 48px 20px 44px;
    background: url("../img/bg-galbani-ep.jpg") center top / cover no-repeat;
}

.page-shell--center {
    display: grid;
    place-items: center;
}

.form-panel,
.message-panel {
    width: min(925px, 100%);
    margin: 0 auto;
    background: var(--color-header);
    border: 2px solid var(--color-text);
}

.form-panel {
    padding: 36px 61px 39px;
}

.intro {
    max-width: 760px;
    margin: 0 auto 47px;
    text-align: center;
}

.intro h1,
.message-panel h1 {
    margin: 0 0 39px;
    color: var(--color-text);
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
}

.intro p,
.message-panel p {
    margin: 0;
    color: var(--color-text);
    font-size: 21px;
    line-height: 1.18;
    letter-spacing: 0;
}

.intro__lead {
    margin-bottom: 30px !important;
    font-weight: 700;
}

.form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 45px;
    row-gap: 29px;
}

.field {
    min-width: 0;
}

.field--full {
    grid-column: 1 / -1;
}

.field__label {
    display: block;
    min-height: 22px;
    margin: 0 0 13px;
    color: var(--color-text);
    font-size: 18px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0;
}

.field__input {
    width: 100%;
    height: 52px;
    padding: 10px 13px;
    border: 1px solid var(--color-text);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 400;
    outline: none;
}

.field__input:focus {
    box-shadow: 0 0 0 3px rgba(244, 152, 17, 0.34);
}

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text);
    -webkit-box-shadow: 0 0 0 1000px var(--color-header) inset;
    caret-color: var(--color-text);
}

.field__error {
    margin: 8px 0 0;
    color: var(--color-accent);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
}

.field__input.is-error {
    border-color: var(--color-accent);
}

.form-error-box {
    display: grid;
    gap: 4px;
    margin: 0 0 25px;
    padding: 14px 16px;
    border: 1px solid var(--color-accent);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.35;
}

.form-error-box strong {
    color: var(--color-accent);
}

.btn-submit {
    display: block;
    width: 430px;
    max-width: 100%;
    height: 88px;
    margin: 10px auto 0;
    border: 0;
    border-radius: 0;
    background: var(--color-accent);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 29px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
}

.btn-submit:hover {
    filter: brightness(0.96);
}

.btn-submit:focus-visible,
.topbar__contact:focus-visible,
.footer__links a:focus-visible,
.text-link:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 4px;
}

.btn-submit[disabled] {
    opacity: 0.72;
    cursor: not-allowed;
}

.footer {
    height: 76px;
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-header);
}

.footer__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.footer__links a,
.text-link {
    color: var(--color-accent);
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message-panel {
    padding: 56px 64px;
    text-align: center;
}

.message-panel__logo {
    width: 146px;
    margin: 0 auto 26px;
}

.message-panel__lead {
    margin-bottom: 18px !important;
    font-weight: 700;
}

.message-panel__reference {
    margin-top: 28px !important;
    font-size: 16px !important;
}

.modal-legal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-legal.is-open {
    display: flex;
}

.modal-legal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.modal-legal__dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-text);
    color: var(--color-header);
    border-radius: 0;
}

.modal-legal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    background: var(--color-header);
    color: var(--color-text);
}

.modal-legal__title {
    margin: 0;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
}

.modal-legal__close {
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-legal__body {
    padding: 28px 32px;
    overflow-y: auto;
    color: var(--color-header);
    font-size: 14px;
    line-height: 1.6;
}

.modal-legal__loading,
.modal-legal__error {
    padding: 32px 16px;
    text-align: center;
}

.modal-legal__error {
    color: #b42318;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 1200px) {
    .topbar__contact {
        font-size: 18px;
    }
}

@media (max-width: 920px) {
    .topbar {
        height: 112px;
        flex-basis: 112px;
    }

    .topbar__inner {
        height: 112px;
        padding: 0 24px;
    }

    .topbar__logo img {
        width: 112px;
        height: 112px;
    }

    .topbar__contact {
        font-size: 15px;
        overflow-wrap: anywhere;
        white-space: normal;
        text-align: right;
    }

    .page-shell {
        min-height: calc(100vh - 188px);
        padding: 32px 16px;
    }

    .form-panel {
        padding: 32px 32px 36px;
    }

    .form {
        column-gap: 28px;
    }
}

@media (max-width: 680px) {
    .topbar__contact {
        font-size: 12px;
    }

    .form-panel {
        padding: 26px 20px 30px;
    }

    .intro {
        margin-bottom: 30px;
    }

    .intro h1,
    .message-panel h1 {
        margin-bottom: 24px;
        font-size: 29px;
    }

    .intro p,
    .message-panel p {
        font-size: 17px;
    }

    .form {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .field--full {
        grid-column: auto;
    }

    .field__label {
        font-size: 16px;
    }

    .btn-submit {
        height: 68px;
        font-size: 22px;
    }

    .footer__links {
        gap: 16px;
        flex-wrap: wrap;
    }

    .footer__links a {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
