/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --bg: #eef1f5;
    --panel: #ffffff;

    --text: #172033;
    --muted: #64748b;

    --border: #e2e8f0;

    --input: #f8fafc;

    --paper-width: 794px;
    --paper-height: 1123px;

    --shadow:
        0 25px 70px rgba(15, 23, 42, .15);

}


/* =========================================================
   BODY
========================================================= */

body {

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--bg);

    color: var(--text);

    min-height: 100vh;

}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {

    height: 72px;

    background: #ffffff;

    border-bottom: 1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 28px;

    position: sticky;

    top: 0;

    z-index: 100;

}


.brand {

    display: flex;

    align-items: center;

    gap: 12px;

}


.brand-icon {

    width: 38px;

    height: 38px;

    border-radius: 10px;

    background: var(--primary);

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 13px;

    font-weight: 800;

}


.brand strong {

    display: block;

    font-size: 15px;

}


.brand span {

    display: block;

    font-size: 11px;

    color: var(--muted);

    margin-top: 2px;

}


.top-actions {

    display: flex;

    gap: 10px;

}


button {

    font-family: inherit;

    cursor: pointer;

}


.btn-primary,
.btn-secondary {

    height: 40px;

    padding: 0 16px;

    border-radius: 8px;

    border: 1px solid var(--border);

    font-weight: 600;

    font-size: 13px;

}


.btn-primary {

    background: var(--primary);

    color: white;

    border-color: var(--primary);

}


.btn-primary:hover {

    background: var(--primary-dark);

}


.btn-secondary {

    background: white;

    color: var(--text);

}


/* =========================================================
   WORKSPACE
========================================================= */

.workspace {

    display: grid;

    grid-template-columns: 440px 1fr;

    min-height: calc(100vh - 72px);

}


/* =========================================================
   EDITOR
========================================================= */

.editor {

    background: #f8fafc;

    border-right: 1px solid var(--border);

    padding: 28px;

    overflow-y: auto;

    height: calc(100vh - 72px);

}


.editor-header {

    margin-bottom: 28px;

}


.editor-header h2 {

    font-size: 22px;

    margin-bottom: 5px;

}


.editor-header p {

    color: var(--muted);

    font-size: 13px;

}


/* =========================================================
   EDITOR SECTIONS
========================================================= */

.editor-section {

    background: white;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 18px;

    margin-bottom: 16px;

}


.section-title {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 18px;

}


.section-title > div {

    display: flex;

    align-items: center;

    gap: 9px;

}


.section-number {

    font-size: 10px;

    font-weight: 800;

    color: var(--primary);

}


.section-title strong {

    font-size: 14px;

}


/* =========================================================
   FORM
========================================================= */

.form-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

}


.field {

    margin-bottom: 12px;

}


.field:last-child {

    margin-bottom: 0;

}


.field.full {

    grid-column: 1 / -1;

}


.field label {

    display: block;

    font-size: 11px;

    font-weight: 700;

    color: #475569;

    margin-bottom: 6px;

}


input,
textarea,
select {

    width: 100%;

    border: 1px solid var(--border);

    background: var(--input);

    border-radius: 8px;

    padding: 10px 11px;

    font-family: inherit;

    font-size: 12px;

    color: var(--text);

    outline: none;

    transition: .2s;

}


textarea {

    resize: vertical;

    line-height: 1.5;

}


input:focus,
textarea:focus,
select:focus {

    border-color: var(--primary);

    background: white;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .08);

}


/* =========================================================
   FOTO
========================================================= */

.photo-upload {

    display: flex;

    align-items: center;

    gap: 13px;

    margin-bottom: 20px;

}


.photo-preview {

    width: 72px;

    height: 72px;

    border-radius: 50%;

    background: #f1f5f9;

    border: 1px dashed #cbd5e1;

    display: flex;

    align-items: center;

    justify-content: center;

    color: var(--muted);

    overflow: hidden;

}


.photo-preview img {

    width: 100%;

    height: 100%;

    object-fit: cover;

}


.photo-upload strong {

    font-size: 12px;

}


.photo-upload p {

    font-size: 10px;

    color: var(--muted);

    margin: 3px 0 7px;

}


.upload-button {

    display: inline-block;

    font-size: 10px;

    color: var(--primary);

    font-weight: 700;

    cursor: pointer;

}


.upload-button input {

    display: none;

}


/* =========================================================
   CORES
========================================================= */

.color-selector label {

    display: block;

    font-size: 11px;

    font-weight: 700;

    margin-bottom: 9px;

}


.colors {

    display: flex;

    gap: 8px;

}


.color {

    width: 25px;

    height: 25px;

    border-radius: 50%;

    border: 3px solid white;

    outline: 1px solid #cbd5e1;

}


.color.active {

    outline: 2px solid var(--text);

}


/* =========================================================
   DYNAMIC CARDS
========================================================= */

.dynamic-card {

    padding: 14px;

    border: 1px solid var(--border);

    background: #f8fafc;

    border-radius: 10px;

    margin-bottom: 10px;

}


.dynamic-card.compact {

    padding-bottom: 4px;

}


.dynamic-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 13px;

}


.dynamic-header strong {

    font-size: 11px;

}


.remove-button,
.remove-skill {

    width: 25px;

    height: 25px;

    border: 0;

    background: #fee2e2;

    color: #dc2626;

    border-radius: 6px;

    font-size: 16px;

}


.add-button {

    border: 0;

    background: transparent;

    color: var(--primary);

    font-size: 11px;

    font-weight: 700;

}


/* =========================================================
   TWO COLUMNS
========================================================= */

.two-columns {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

}


/* =========================================================
   SKILLS
========================================================= */

.skill-row {

    display: grid;

    grid-template-columns: 1fr 28px;

    gap: 7px;

    margin-bottom: 8px;

}


/* =========================================================
   LANGUAGE
========================================================= */

.language-row {

    display: grid;

    grid-template-columns: 1fr 120px 28px;

    gap: 7px;

    margin-bottom: 8px;

}


/* =========================================================
   PREVIEW AREA
========================================================= */

.preview-area {

    min-width: 0;

    overflow: auto;

    background:

        radial-gradient(
            circle at center,
            #f8fafc 0,
            #e2e8f0 100%
        );

    padding: 28px;

}


.preview-toolbar {

    height: 48px;

    max-width: 850px;

    margin: 0 auto 20px;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.preview-toolbar strong {

    font-size: 13px;

}


.preview-toolbar span {

    display: block;

    font-size: 10px;

    color: var(--muted);

    margin-top: 3px;

}


.zoom-controls {

    display: flex !important;

    align-items: center;

    gap: 7px;

}


.zoom-controls button {

    width: 30px;

    height: 30px;

    border: 1px solid var(--border);

    background: white;

    border-radius: 6px;

    font-size: 18px;

}


.zoom-controls span {

    width: 42px;

    text-align: center;

    margin: 0;

}


/* =========================================================
   PAPER
========================================================= */

.paper-wrapper {

    display: flex;

    justify-content: center;

    padding-bottom: 60px;

}


.resume {

    width: var(--paper-width);

    min-height: var(--paper-height);

    background: white;

    box-shadow: var(--shadow);

    transform-origin: top center;

    position: relative;

    overflow: hidden;

}


/* =========================================================
   RESUME HEADER
========================================================= */

.resume-header {

    min-height: 220px;

    background:

        linear-gradient(
            135deg,
            var(--primary),
            #172554
        );

    color: white;

    padding: 42px 45px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    position: relative;

}


.resume-header::after {

    content: "";

    position: absolute;

    width: 260px;

    height: 260px;

    border-radius: 50%;

    border: 45px solid rgba(255,255,255,.05);

    right: -100px;

    top: -90px;

}


.header-info {

    position: relative;

    z-index: 2;

}


.resume-name {

    font-size: 31px;

    font-weight: 800;

    letter-spacing: -.8px;

    text-transform: uppercase;

    margin-bottom: 7px;

}


.resume-job {

    font-size: 13px;

    font-weight: 600;

    letter-spacing: 2px;

    text-transform: uppercase;

    opacity: .85;

}


.contact-list {

    display: flex;

    flex-wrap: wrap;

    gap: 8px 18px;

    margin-top: 22px;

    max-width: 470px;

}


.contact-list span {

    font-size: 9px;

    opacity: .9;

}


.resume-photo {

    width: 105px;

    height: 105px;

    border-radius: 50%;

    background: rgba(255,255,255,.12);

    border: 5px solid rgba(255,255,255,.3);

    position: relative;

    z-index: 3;

    overflow: hidden;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 10px;

    font-weight: 700;

}


.resume-photo img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: none;

}


/* =========================================================
   RESUME BODY
========================================================= */

.resume-body {

    display: grid;

    grid-template-columns: 1fr 245px;

}


.main-column {

    padding: 35px 38px 50px 45px;

}


.side-column {

    background: #f7f9fc;

    border-left: 1px solid #edf1f5;

    padding: 35px 25px;

}


/* =========================================================
   RESUME SECTIONS
========================================================= */

.resume-section {

    margin-bottom: 30px;

}


.resume-section h2 {

    display: flex;

    align-items: center;

    gap: 9px;

    font-size: 13px;

    text-transform: uppercase;

    letter-spacing: 1.2px;

    color: #172033;

    padding-bottom: 10px;

    border-bottom: 2px solid #e9edf3;

    margin-bottom: 18px;

}


.section-icon {

    color: var(--primary);

    font-size: 13px;

}


.profile-text {

    font-size: 10px;

    line-height: 1.75;

    color: #526174;

}


/* =========================================================
   TIMELINE
========================================================= */

.timeline-item {

    display: grid;

    grid-template-columns: 105px 1fr;

    gap: 17px;

    position: relative;

    margin-bottom: 22px;

}


.timeline-date {

    font-size: 8px;

    font-weight: 700;

    color: var(--primary);

    text-transform: uppercase;

    line-height: 1.5;

}


.timeline-content {

    border-left: 2px solid #e6eaf0;

    padding-left: 17px;

    position: relative;

}


.timeline-content::before {

    content: "";

    width: 7px;

    height: 7px;

    border-radius: 50%;

    background: var(--primary);

    position: absolute;

    left: -4.5px;

    top: 3px;

}


.timeline-content h3 {

    font-size: 11px;

    margin-bottom: 3px;

}


.timeline-content h4 {

    color: var(--primary);

    font-size: 9px;

    margin-bottom: 7px;

}


.timeline-content p {

    font-size: 9px;

    line-height: 1.65;

    color: #59677a;

}


/* =========================================================
   FORMAÇÃO
========================================================= */

.education-item {

    display: grid;

    grid-template-columns: 105px 1fr;

    gap: 17px;

    margin-bottom: 17px;

}


.education-date {

    font-size: 8px;

    color: var(--primary);

    font-weight: 700;

}


.education-item h3 {

    font-size: 10px;

    margin-bottom: 4px;

}


.education-item p {

    font-size: 9px;

    color: #64748b;

}


/* =========================================================
   CURSOS
========================================================= */

.course-item {

    border-left: 3px solid var(--primary);

    padding-left: 10px;

    margin-bottom: 13px;

}


.course-item strong {

    display: block;

    font-size: 9px;

}


.course-item span {

    display: block;

    font-size: 8px;

    color: var(--muted);

    margin-top: 3px;

}


/* =========================================================
   SIDE COLUMN
========================================================= */

.side-section {

    margin-bottom: 30px;

}


.side-section h2 {

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1.3px;

    margin-bottom: 15px;

    color: #1e293b;

}


.skill-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.skill-list span {

    font-size: 9px;

    background: white;

    border: 1px solid #e6eaf0;

    padding: 8px 9px;

    border-radius: 5px;

    color: #475569;

}


.language-item {

    margin-bottom: 12px;

}


.language-item strong {

    display: block;

    font-size: 9px;

}


.language-item span {

    font-size: 8px;

    color: var(--primary);

    margin-top: 3px;

    display: block;

}


.mini-contact > div {

    margin-bottom: 12px;

}


.mini-contact b {

    display: block;

    font-size: 8px;

    color: #64748b;

    text-transform: uppercase;

    margin-bottom: 3px;

}


.mini-contact span {

    font-size: 8px;

    word-break: break-word;

}


/* =========================================================
   FOOTER
========================================================= */

.resume-footer {

    position: absolute;

    bottom: 0;

    left: 0;

    right: 0;

    height: 25px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 7px;

    color: #94a3b8;

    border-top: 1px solid #edf0f4;

}


/* =========================================================
   DARK MODE
========================================================= */

body.dark {

    --bg: #0f172a;

    --panel: #111827;

    --text: #f8fafc;

    --muted: #94a3b8;

    --border: #263244;

    --input: #182235;

}


body.dark .topbar,
body.dark .editor-section {

    background: #111827;

}


body.dark .editor {

    background: #0f172a;

}


body.dark input,
body.dark textarea,
body.dark select {

    color: white;

}


body.dark .btn-secondary {

    background: #182235;

    color: white;

}


/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 1100px) {

    .workspace {

        grid-template-columns: 360px 1fr;

    }

    .editor {

        padding: 18px;

    }

}


@media (max-width: 850px) {

    .workspace {

        display: block;

    }

    .editor {

        height: auto;

        max-height: none;

        border-right: 0;

    }

    .preview-area {

        min-height: 900px;

    }

}


@media (max-width: 600px) {

    .topbar {

        padding: 0 15px;

    }

    .brand span {

        display: none;

    }

    .btn-secondary {

        display: none;

    }

    .editor {

        padding: 12px;

    }

    .form-grid {

        grid-template-columns: 1fr;

    }

    .field.full {

        grid-column: auto;

    }

    .preview-area {

        padding: 10px;

        overflow-x: auto;

    }

}

/* =========================================================
   IMPRESSÃO A4 — SOMENTE O CURRÍCULO
========================================================= */

@media print {

    @page {
        size: A4 portrait;
        margin: 0;
    }

    html,
    body {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;

        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }


    /* ESCONDER INTERFACE */

    .topbar,
    .editor,
    .preview-toolbar {
        display: none !important;
    }


    /* ÁREA DO PREVIEW */

    .workspace {
        display: block !important;

        width: 210mm !important;
        height: 297mm !important;

        min-height: 297mm !important;

        margin: 0 !important;
        padding: 0 !important;
    }


    .preview-area {
        width: 210mm !important;
        height: 297mm !important;

        min-height: 297mm !important;

        margin: 0 !important;
        padding: 0 !important;

        background: white !important;

        overflow: visible !important;
    }


    .paper-wrapper {
        display: block !important;

        width: 210mm !important;
        height: 297mm !important;

        margin: 0 !important;
        padding: 0 !important;
    }


    /* FOLHA A4 */

    .resume {
        width: 210mm !important;
        height: 297mm !important;

        min-height: 297mm !important;

        margin: 0 !important;
        padding: 0 !important;

        transform: none !important;

        box-shadow: none !important;

        overflow: hidden !important;

        background: white !important;

        page-break-after: avoid !important;
    }


    /* CABEÇALHO COLORIDO */

    .resume-header {
        background:
            linear-gradient(
                135deg,
                var(--primary),
                #172554
            ) !important;

        color: white !important;

        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }


    .resume-header::after {
        display: block !important;
    }


    /* GARANTE QUE AS CORES INTERNAS APAREÇAM */

    .resume-job,
    .contact-list span {
        color: white !important;
    }


    /* EVITA QUE SEÇÕES SEJAM CORTADAS */

    .resume-section,
    .side-section,
    .timeline-item,
    .education-item,
    .course-item {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }


    /* RODAPÉ */

    .resume-footer {
        display: flex !important;
    }

}