@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --primary: #f9b919;
    --secondary: #415777;
    --tertiary: #082c5a;
    --title: #001c43;
    --subtitle: #666666;
    --btn-download: #415777;
    --btn-voltar: #ff2969;
    --btn-lang: #415777;
    --text: #415777;
    --surface: #fff;
    --surface-muted: #e8edf3;
    --border-soft: rgba(65, 87, 119, 0.12);
    --shadow-soft: 0 18px 40px rgba(25, 25, 25, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background:
        url('../img/bg-tl-2.png') top left no-repeat,
        url('../img/bg-br-2.png') bottom right no-repeat,
        url('../img/bg-tl-1.png') top center / 100% 25px no-repeat,
        url('../img/bg-bl-1.png') bottom center / 100% 25px no-repeat,
        #fff;
    color: var(--text);
    font-family: "Barlow", sans-serif;
    font-size: 16px;
    font-weight: 400;
}

body.page-download {
    background: #fff;
    color: #333;
}

.lang-switcher {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.lang-switcher-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(65, 87, 119, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.lang-switcher-button:hover {
    transform: translateY(-1px);
    background: var(--btn-lang);
    color: #fff;
}

.lang-switcher-button.is-active {
    background: var(--btn-lang);
    color: #fff;
}

::placeholder {
    color: var(--text);
    opacity: 1;
}

.primary-color {
    color: var(--primary);
}

.secondary-color {
    color: var(--secondary);
}

.tertiary-color {
    color: var(--tertiary);
}

header {
    width: 100%;
    padding: 20px 0 0;
}

body.has-language-switcher header {
    padding-top: 80px;
}

header h2 {
    margin: 0;
    padding: 40px 0 0;
    color: var(--title);
    font-size: 36px;
    font-weight: 700;
    font-style: italic;
    text-align: center;
}

header h3 {
    margin: 0;
    padding: 14px 0 20px;
    /* border-bottom: 1px solid var(--primary); */
    color: var(--subtitle);
    font-size: 22px;
    font-weight: 300;
    font-style: italic;
    text-align: center;
}

main {
    position: relative;
    margin: 30px auto;
    padding-bottom: 32px;
}

.site-footer {
    padding: 0 0 28px;
}

.site-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.site-footer-link img {
    display: block;
    width: 55px;
    height: auto;
}

figure.model {
    position: relative;
    margin: 0;
}

.preview-surface {
    display: inline-block;
    background: var(--surface);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

.preview-composer {
    width: 100%;
}

.preview-stage {
    position: relative;
}

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

.preview-overlay {
    position: relative;
    z-index: 2;
}

.preview-user-image,
.preview-user-text {
    position: absolute;
    z-index: 1;
}

.preview-user-image {
    display: none;
    object-fit: contain;
}

.preview-user-image.is-visible {
    display: block;
}

.preview-user-text {
    display: none;
    min-width: 1px;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-family: "Open Sans", sans-serif;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-user-text.is-visible {
    display: flex;
}

figure.model::before {
    display: none;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
    margin: 0;
    padding: 24px 30px 32px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    font-size: 14px;
    line-height: 16px;
}

.form-section {
    position: relative;
    min-width: 0;
    margin: 10px 0 0;
    padding: 24px 18px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
}

.form-section legend {
    position: absolute;
    top: 0;
    left: 14px;
    width: auto;
    margin: 0;
    padding: 0 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    transform: translateY(-50%);
}

.form label {
    width: 150px;
    margin: 0;
    padding-right: 8px;
    font-weight: 700;
    text-align: right;
}

.form input {
    width: 100%;
    height: 35px;
    margin: 5px 0;
    padding: 5px 15px;
    border: 0;
    border-radius: 4px;
    outline: 0;
    background: var(--surface-muted);
    color: #333;
    font-size: 16px;
    line-height: 18px;
}

.file-input-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.file-input-button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 70px;
    padding: 14px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-muted);
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.form label.file-input-label {
    width: 100%;
    margin: 0;
    padding-right: 0;
    text-align: left;
}

.file-input-button:hover {
    border-color: rgba(65, 87, 119, 0.28);
    transform: translateY(-1px);
}

.file-input-button.is-invalid {
    border: 1px solid #d94b4b;
    box-shadow: 0 0 0 3px rgba(217, 75, 75, 0.12);
}

.file-input-native:focus + .file-input-button {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(65, 87, 119, 0.14);
}

.file-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(65, 87, 119, 0.1);
    color: var(--text);
    flex: 0 0 auto;
}

.file-input-icon .bi {
    font-size: 18px;
    line-height: 1;
}

.file-input-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.file-input-copy strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.file-input-name {
    color: rgba(51, 51, 51, 0.72);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form input[type="file"] {
    display: none;
}

.file-input-error {
    margin: 8px 0 0;
    color: #d94b4b;
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    line-height: 1.35;
}

.disclaimer {
    font-size: 12px;
    font-style: italic;
    line-height: 18px;
}

.disclaimer-icon {
    flex: 0 0 auto;
    align-self: flex-start;
    color: var(--tertiary);
    font-size: 14px;
    line-height: 1;
}

.btn-generate {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 30px auto 0;
    padding: 12px 40px;
    border-radius: 8px;
    background: var(--primary);
    box-shadow: 0 5px 0 #d89b00;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    font-weight: 500;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.btn-generate:hover {
    opacity: 0.94;
    transform: scale(1.05);
}

.btn-generate .bi {
    font-size: 20px;
    line-height: 1;
}

.page-download {
    padding-top: 110px;
}

.page-download main {
    padding-bottom: 100px;
}

.result-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    padding: 18px 0;
    border-bottom: 1px solid rgba(241, 146, 11, 0.35);
    background: rgba(46, 42, 45, 0.94);
    backdrop-filter: blur(10px);
}

.result-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.result-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 6px;
    background: var(--btn-voltar);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.result-back:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.result-back i {
    font-size: 15px;
    line-height: 1;
}

.result-signature {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.result-signature img {
    display: block;
    width: 76px;
    height: auto;
}

.page-download .item {
    position: relative;
    max-width: 600px;
    margin: 0 auto 50px;
    padding: 38px 28px 30px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.page-download .item h2 {
    position: absolute;
    top: 0;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 24px);
    margin: 0;
    padding: 0 8px;
    background: var(--surface);
    color: #5f6b7d;
    font-size: 20px;
    line-height: 1.2;
    transform: translate(-50%, -50%);
}

.page-download .item h2 .bi {
    margin-right: 0;
}

.page-download .item img {
    max-width: 100%;
    height: auto;
}

.page-download .item p {
    margin: 18px 0 0;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 154px;
    min-height: 40px;
    margin-top: 16px;
    padding: 0 18px;
    border-radius: 6px;
    border: 1px solid rgba(95, 107, 125, 0.28);
    background: var(--surface);
    color: #5f6b7d;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.download-button:hover {
    background: var(--surface);
    color: #5f6b7d;
    transform: translateY(-1px);
}

.download-button-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

@media (max-width: 992px) {
    .lang-switcher {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .lang-switcher-button {
        width: 42px;
        height: 42px;
        font-size: 11px;
    }

    body {
        background-image:
            url('../img/bg-tl-1.png'),
            url('../img/bg-bl-1.png'),
            none;
        background-repeat: no-repeat, no-repeat, no-repeat;
        background-position: top center, bottom center, center center;
        background-size: 100% 25px, 100% 25px, cover;
    }

    header {
        padding-top: 20px;
    }

    body.has-language-switcher header {
        padding-top: 72px;
    }

    header h2 {
        text-align: center;
    }

    figure.model {
        margin: 0 auto;
        text-align: center;
    }

    figure.model::before {
        display: none;
    }

    .form {
        margin-top: 30px;
        padding: 24px 24px 28px;
        text-align: center;
    }

    .form-section {
        text-align: center;
    }

    .form-section legend {
        left: 50%;
        max-width: calc(100% - 24px);
        padding: 0 8px;
        font-size: 13px;
        white-space: nowrap;
        transform: translate(-50%, -50%);
        text-align: center;
    }

    .form input {
        border-radius: 15px;
        text-align: center;
    }

    .form label {
        width: auto;
        margin-top: 10px;
        padding: 0;
        text-align: center;
    }

    .form label.file-input-label {
        width: 100%;
        margin-top: 0;
        text-align: center;
    }

    .file-input-button {
        justify-content: center;
    }

    .file-input-copy {
        flex: 0 1 auto;
        text-align: center;
    }

    .disclaimer {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    header h2 {
        padding-top: 20px;
        font-size: 20px;
        line-height: 24px;
    }

    header h3 {
        padding-top: 10px;
        font-size: 18px;
        line-height: 22px;
    }

    main {
        margin-top: 20px;
        padding-bottom: 24px;
    }

    .page-download {
        padding-top: 92px;
    }

    .result-bar {
        padding: 14px 0;
    }

    .download-button,
    .btn-generate {
        width: 100%;
    }

    .result-back {
        width: auto;
        margin: 0 auto;
        justify-content: center;
        text-align: center;
    }

    .result-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .result-signature {
        justify-content: center;
    }

    .form {
        padding: 32px 18px 24px;
    }

    .form-section legend {
        left: 50%;
        font-size: 13px;
        transform: translate(-50%, -50%);
    }

    .btn-generate {
        font-size: 18px;
    }

    .page-download .item {
        padding: 34px 20px 24px;
    }

    .page-download .item h2 {
        font-size: 17px;
    }

}
