
:root {
    --blue: #063d68;
    --blue2: #0a5b96;
    --ink: #172536;
    --muted: #6b7b8f;
    --bg: #eef3f8;
    --line: #dce5ee;
    --white: #fff;
    --ok: #14935f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
}

/* CABEÇALHO */

.topbar {
    height: 76px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, calc((100vw - 1480px) / 2));
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark {
    background: var(--blue);
    color: #fff;
    font-weight: 900;
    padding: 11px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 17px;
}

.brand small {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.badge {
    background: #edf5fb;
    color: var(--blue);
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
}

/* LAYOUT PRINCIPAL */

.layout {
    max-width: 1480px;
    margin: 28px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 560px;
    gap: 28px;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(20, 50, 80, 0.07);
}

.form-panel {
    padding: 30px;
}

/* TÍTULOS E ETAPAS */

.step-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.step-title.compact {
    margin-top: 30px;
    margin-bottom: 18px;
}

.step-title > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-weight: 800;
    flex: 0 0 auto;
}

.step-title h1,
.step-title h2 {
    margin: 0 0 5px;
}

.step-title h1 {
    font-size: 25px;
}

.step-title h2 {
    font-size: 19px;
}

.step-title p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

/* FORMULÁRIOS */

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: 1fr 1fr;
}

label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 15px;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 7px;
    border: 1px solid #cfdbe7;
    background: #fbfdff;
    border-radius: 11px;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
    outline: none;
    transition: 0.2s;
}

textarea {
    resize: vertical;
    min-height: 250px;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #5da1d4;
    box-shadow: 0 0 0 3px rgba(22, 111, 177, 0.10);
    background: #fff;
}

/* MODELOS */

.templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.template-card {
    border: 2px solid var(--line);
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    background: #fff;
}

.template-card input {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--blue);
}

.template-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    border: 1px solid #edf0f4;
    background: #fff;
}

.template-card strong,
.template-card small {
    display: block;
    margin-top: 8px;
}

.template-card small {
    font-weight: 400;
    color: var(--muted);
    margin-top: 3px;
}

.template-card.active {
    border-color: var(--blue2);
    box-shadow: 0 0 0 3px rgba(10, 91, 150, 0.08);
}

/* CONTADOR E CHECKBOX */

.counter {
    display: block;
    text-align: right;
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
    margin-top: 5px;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #4e5e70;
    font-weight: 400;
    line-height: 1.45;
}

.check input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--blue);
}

/* BOTÃO PRINCIPAL */

.primary {
    width: 100%;
    border: 0;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    color: #fff;
    border-radius: 12px;
    padding: 15px 18px;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(6, 61, 104, 0.18);
}

.primary b {
    font-size: 20px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* PRÉVIA DO DOCUMENTO */

.preview-wrap {
    position: sticky;
    top: 100px;
    align-self: start;
}

.preview-head {
    display: flex;
    justify-content: space-between;
    margin: 0 2px 10px;
}

.preview-head span {
    font-size: 12px;
    color: var(--muted);
}

.paper {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    background: #fff;
    box-shadow: 0 16px 42px rgba(23, 37, 54, 0.16);
    overflow: hidden;
}

.paper > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.paper-content {
    position: absolute;
    left: 13%;
    right: 13%;
    top: 16.5%;
    bottom: 11%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.5px;
    line-height: 1.5;
    color: #111;
}

.paper.ld5 .paper-content {
    top: 16%;
}

.paper-content h3,
.paper-content h4 {
    text-align: center;
    margin: 0;
    font-family: Georgia, serif;
}

.paper-content h3 {
    font-size: 15px;
}

.paper-content h4 {
    font-size: 13px;
    margin: 2px 0 12px;
}

.paper-content > div {
    text-align: center;
    font-family: Georgia, serif;
}

.paper-content p {
    margin: 4px 0;
}

.paper-content .question {
    text-align: center;
    font-style: italic;
    font-size: 10px;
    margin: 12px 0 15px;
}

/* RESPOSTA: FORMATAÇÃO DO TEXTO */

.paper-content .answer {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;

    text-align: justify !important;
    text-align-last: left !important;
    text-justify: inter-word !important;

    text-indent: 0 !important;

    white-space: normal !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
    hyphens: none;

    margin: 0 !important;
    padding: 0 !important;
}

/* RECUO E ALINHAMENTO DE CADA PARÁGRAFO */

.paper-content .answer p {
    display: block !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;

    text-align: justify !important;
    text-align-last: left !important;
    text-justify: inter-word !important;

    text-indent: 1.25cm !important;

    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;

    margin: 0 0 0.5em 0 !important;
    padding: 0 !important;
}

.paper-content .answer p:last-child {
    margin-bottom: 0 !important;
}

/* SE O CONTEÚDO TIVER LISTAS */

.paper-content .answer ul,
.paper-content .answer ol {
    padding-left: 1.25cm !important;
    margin: 0 0 0.5em 0 !important;
}

.paper-content .answer li {
    text-align: justify !important;
    line-height: 1.5 !important;
}

/* RODAPÉ */

footer {
    text-align: center;
    padding: 22px;
    color: #77889a;
    font-size: 12px;
}

/* TELA DE SUCESSO */

.success-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(150deg, #eaf2f8, #f7f9fc);
}

.success-card {
    width: min(650px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 20px 55px #1232;
    padding: 38px;
    text-align: center;
}

.ok {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    background: #e9f8f1;
    color: var(--ok);
    font-size: 32px;
    font-weight: 900;
}

.success-card h1 {
    margin: 0 0 8px;
}

.success-card > p {
    color: var(--muted);
    line-height: 1.5;
}

.summary {
    margin: 25px 0;
    text-align: left;
    background: #f7fafc;
    border-radius: 13px;
    padding: 16px;
}

.summary span {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #e9eef3;
    word-break: break-word;
}

.summary span:last-child {
    border-bottom: 0;
}

.summary b {
    display: inline-block;
    width: 85px;
}

.linkbtn {
    text-decoration: none;
}

.back {
    display: inline-block;
    margin-top: 20px;
    color: var(--blue2);
    text-decoration: none;
    font-weight: 700;
}

.mini {
    font-size: 11px !important;
    margin-top: 25px;
}

/* RESPONSIVIDADE */

@media (max-width: 1050px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .preview-wrap {
        position: static;
        max-width: 600px;
        margin: auto;
    }

    .topbar {
        padding: 0 18px;
    }
}

@media (max-width: 650px) {
    .layout {
        padding: 0 12px;
        margin: 14px auto;
    }

    .form-panel {
        padding: 20px;
    }

    .grid.two,
    .templates {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: 68px;
    }

    .brand small {
        display: none;
    }

    .badge {
        font-size: 10px;
    }

    .template-card img {
        height: 180px;
    }

    .paper-content {
        font-size: 8px;
    }

    .step-title h1 {
        font-size: 21px;
    }
}
