:root {
    --bg: #f4f1ee;
    --surface: #ffffff;
    --surface-soft: #faf8f6;
    --ink: #2f2d2c;
    --muted: #776f6a;
    --line: #ddd5cf;
    --accent: #f2672f;
    --accent-dark: #cf4d1d;
    --charcoal: #4e4a48;
    --shadow: 0 18px 45px rgba(63, 53, 47, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    display: grid;
    grid-template-columns: minmax(360px, 460px) minmax(520px, 1fr);
    gap: 20px;
    width: min(1500px, calc(100% - 32px));
    min-height: calc(100vh - 36px);
    margin: 0 auto;
    padding: 18px 0;
}

.sidebar,
.preview-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.sidebar h2 {
    margin: 0 0 4px;
}

.client-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    align-items: stretch;
}

.file-control {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 42px;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}

.file-control input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-control span,
.file-control small {
    position: relative;
    pointer-events: none;
}

.file-control span {
    font-size: 0.86rem;
    font-weight: 800;
}

.file-control small {
    color: var(--muted);
    font-size: 0.72rem;
}

.file-control-document {
    padding: 10px 12px;
    border: 1px dashed #c9bdb5;
    background: var(--surface-soft);
    color: var(--charcoal);
}

.file-control-logo {
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--accent);
    background: #fff7f2;
    color: var(--accent-dark);
    text-align: center;
}

.comercial-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.comercial-section textarea,
.comercial-section input:last-of-type {
    grid-column: 1 / -1;
}

.btn-download {
    min-height: 46px;
    margin-top: 4px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.btn-download:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.download-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.secondary-button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--charcoal);
    cursor: pointer;
    font-weight: 700;
}

.live-add-button {
    border-color: var(--accent);
    background: #fff2ea;
    color: var(--accent-dark);
}

.live-add-button:hover {
    background: #ffe5d7;
}

.custom-slide-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.custom-slide-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.custom-slide-section h3 {
    margin: 0;
    color: var(--charcoal);
    font-size: 1rem;
}

.custom-slide-heading span {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.custom-slides-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.custom-slide-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.custom-slide-item button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.preview-area {
    position: sticky;
    top: 18px;
    min-height: calc(100vh - 36px);
    padding: 14px;
}

#preview {
    display: block;
    width: 100%;
    height: calc(100vh - 66px);
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ece5df;
}

.app-shell {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 36px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.app-header img {
    width: min(290px, 54vw);
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    gap: 20px;
    align-items: start;
}

.editor-panel,
.preview-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.editor-panel {
    padding: 22px;
}

.preview-panel {
    position: sticky;
    top: 18px;
    padding: 18px;
}

.panel-heading,
.preview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading span,
.preview-header span,
.format-select span {
    display: block;
    color: var(--accent-dark);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1,
h2 {
    margin: 4px 0 0;
    color: var(--charcoal);
    line-height: 1.05;
}

h1 {
    font-size: 1.65rem;
}

h2 {
    font-size: 1.15rem;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

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

.field span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d9d0c9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

input,
select {
    min-height: 42px;
    padding: 0 12px;
}

textarea {
    min-height: 110px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 103, 47, 0.14);
}

.export-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.format-select {
    width: 190px;
}

.primary-button,
.import-button,
.preview-controls button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.primary-button {
    min-height: 44px;
    padding: 0 28px;
}

.import-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    overflow: hidden;
}

.import-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.slide-counter {
    color: var(--muted);
    font-size: 0.95rem;
}

.slide-counter b {
    color: var(--accent);
}

.preview-stage {
    display: grid;
    place-items: center;
    min-height: 460px;
    padding: 10px;
    background: #ece5df;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.proposal-slide {
    width: min(100%, 880px);
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #fffaf6 url("../img/fundo.png") center / 100% 100% no-repeat;
    border-radius: 4px;
    box-shadow: 0 16px 35px rgba(51, 42, 37, 0.18);
    padding: 44px 52px;
    color: #282422;
}

.proposal-slide::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: var(--accent);
}

.proposal-slide h2 {
    position: relative;
    margin: 0 0 24px;
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.proposal-slide p {
    position: relative;
    margin: 0;
    font-size: clamp(0.78rem, 1.8vw, 1.05rem);
    line-height: 1.5;
    white-space: pre-line;
}

.cover-slide {
    padding: 0;
    background: #222;
}

.cover-slide::before {
    display: none;
}

.cover-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-logo-main {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32%;
    height: auto;
    transform: translate(-50%, -50%);
}

.cover-logo-vertical {
    width: 24%;
    max-width: 230px;
}

.cover-logo-horizontal-white {
    width: 48%;
    max-width: 430px;
}

.slide-logo {
    max-width: 100%;
    height: auto;
}

.image-only-slide {
    padding: 0;
    background: #fff;
}

.image-only-slide::before {
    display: none;
}

.image-only-slide > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-two,
.slide-three {
    padding: 0;
    background: #111;
    color: #fff;
}

.slide-two::before,
.slide-three::before {
    display: none;
}

.slide-two > img,
.slide-three > img,
.final-slide > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.s2-dark {
    position: absolute;
    inset: 0 50% 0 0;
    background: #2e2e2d;
    clip-path: polygon(0 0, 100% 0, 58% 51%, 100% 100%, 0 100%);
}

.s2-text {
    position: absolute;
    left: 6.5%;
    top: 7%;
    width: 30%;
    font-family: Arial, Helvetica, sans-serif;
}

.s2-text img {
    width: 36%;
    margin-bottom: 7%;
}

.s2-text h3 {
    margin: 0 0 13%;
    color: #fff;
    font-size: clamp(0.45rem, 1.2vw, 0.78rem);
    line-height: 1.45;
    font-weight: 800;
}

.s2-text h3 b,
.slide-three b {
    color: var(--accent);
}

.s2-text p {
    margin: 0 0 8%;
    color: #fff;
    font-size: clamp(0.42rem, 1vw, 0.68rem);
    line-height: 1.35;
    font-weight: 700;
}

.s2-address,
.s2-caption {
    position: absolute;
    color: #fff;
    font-size: clamp(0.34rem, 0.78vw, 0.52rem);
    line-height: 1.25;
    font-weight: 700;
}

.s2-address {
    left: 35%;
    top: 68%;
}

.s2-caption {
    left: 43%;
    bottom: 6%;
    text-align: center;
}

.s2-caption span {
    display: block;
    font-weight: 400;
}

.s3-mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.84);
}

.s3-mask.left {
    left: 4%;
    top: 9%;
    width: 41%;
    height: 79%;
}

.s3-mask.right {
    right: 2%;
    top: 12%;
    width: 45%;
    height: 76%;
}

.s3-title {
    position: absolute;
    left: 13%;
    top: 14%;
    text-align: center;
    font-weight: 800;
}

.s3-title span,
.s3-title b {
    display: block;
    font-size: clamp(0.75rem, 2vw, 1.35rem);
}

.pain {
    position: absolute;
    display: grid;
    grid-template-columns: 42% 58%;
    gap: 10px;
    align-items: start;
    color: #fff;
}

.pain strong {
    text-align: right;
    font-size: clamp(0.54rem, 1.35vw, 0.9rem);
    line-height: 1.05;
}

.pain p {
    font-size: clamp(0.48rem, 1.08vw, 0.76rem);
    line-height: 1.1;
    color: #fff;
}

.p1 {
    left: 5%;
    top: 36%;
    width: 36%;
}

.p2 {
    right: 6%;
    top: 36%;
    width: 42%;
}

.p3 {
    left: 5%;
    top: 61%;
    width: 36%;
}

.p4 {
    right: 6%;
    top: 61%;
    width: 42%;
}

.s3-side {
    position: absolute;
    right: 2%;
    bottom: 5%;
    writing-mode: vertical-rl;
    letter-spacing: 0.16em;
    font-size: clamp(0.45rem, 1vw, 0.68rem);
}

.model-slide {
    padding: 44px 58px 76px 70px;
    background: #fffaf6 url("../img/fundo.png") center / 100% 100% no-repeat;
}

.model-slide::before {
    display: none;
}

.model-slide h2 {
    margin-bottom: 22px;
    color: #4d4946;
    font-size: clamp(1.05rem, 2.8vw, 1.75rem);
}

.model-slide h3,
.model-slide h4 {
    position: relative;
    margin: 0 0 14px;
    color: #202020;
    font-size: clamp(0.72rem, 1.6vw, 1rem);
}

.model-slide p,
.model-slide li,
.model-slide td,
.model-slide th {
    position: relative;
    color: #202020;
    font-size: clamp(0.58rem, 1.24vw, 0.86rem);
    line-height: 1.42;
}

.model-slide p {
    margin: 0 0 12px;
}

.model-slide ul {
    position: relative;
    margin: 0 0 14px 18px;
    padding: 0;
}

.model-slide mark {
    background: #fff36d;
    color: inherit;
    white-space: pre-line;
}

.small-text p {
    font-size: clamp(0.45rem, 1vw, 0.64rem);
    line-height: 1.25;
}

.resources-box {
    position: relative;
    max-width: 84%;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid #ead8ce;
    border-radius: 8px;
    padding: 22px;
}

.final-slide {
    padding: 0;
    background: #fff;
}

.final-slide::before {
    display: none;
}

.resources-box table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.resources-box th,
.resources-box td {
    border: 1px solid #e2d1c7;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.resources-box th {
    width: 28%;
    background: rgba(242, 103, 47, 0.12);
}

.confidentiality-slide p {
    max-width: 82%;
    margin-bottom: 9px;
    font-size: clamp(0.52rem, 1.02vw, 0.72rem);
    line-height: 1.32;
}

.confidentiality-slide h2 {
    margin-bottom: 18px;
    font-size: clamp(1rem, 2.35vw, 1.55rem);
}

.brand-slide,
.closing-slide {
    display: grid;
    place-items: center;
}

.brand-slide::before,
.closing-slide::before {
    display: none;
}

.brand-slide .slide-logo {
    width: 360px;
}

.closing-slide .slide-logo {
    width: 420px;
}

.closing-slide h2 {
    margin-top: 34px;
}

.info-grid {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 14px 18px;
    position: relative;
}

.info-grid strong {
    color: var(--accent-dark);
}

.timeline-table {
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 0.85fr 0.85fr;
    gap: 12px;
}

.timeline-table div {
    min-height: 150px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #e6d8ce;
    border-left: 5px solid var(--accent);
    border-radius: 8px;
}

.timeline-table strong {
    display: block;
    margin-bottom: 12px;
    color: var(--charcoal);
}

.timeline-table span {
    display: block;
    line-height: 1.45;
    white-space: pre-line;
}

.total-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 86px;
    padding: 0 34px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid #ead7ca;
    color: var(--accent-dark);
    font-size: clamp(1.7rem, 5vw, 3.1rem);
    font-weight: 800;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.preview-controls button {
    width: 42px;
    height: 38px;
    font-size: 1.5rem;
    line-height: 1;
}

.print-body {
    background: #fff;
}

.print-document {
    width: 100%;
}

@media print {
    @page {
        size: 16in 9in;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .proposal-slide {
        width: 16in;
        height: 9in;
        border-radius: 0;
        box-shadow: none;
        page-break-after: always;
        break-after: page;
    }
}

@media (max-width: 1050px) {
    .container,
    .workspace,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .preview-area,
    .preview-panel {
        position: static;
    }

    #preview {
        height: 70vh;
    }
}

@media (max-width: 620px) {
    .container,
    .app-shell {
        width: min(100% - 18px, 1500px);
    }

    .sidebar,
    .preview-area {
        padding: 14px;
    }

    .comercial-section {
        grid-template-columns: 1fr;
    }

    .download-actions {
        grid-template-columns: 1fr;
    }

    .client-row {
        grid-template-columns: 1fr;
    }

    .app-header,
    .export-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .format-select {
        width: 100%;
    }

    .proposal-slide {
        padding: 28px 30px 28px 42px;
    }

    .timeline-table,
    .info-grid {
        grid-template-columns: 1fr;
    }
}
