:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e4e7ef;
    --border-strong: #cfd5e2;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-50: #eef2ff;
    --success: #059669;
    --success-50: #ecfdf5;
    --danger: #dc2626;
    --danger-50: #fef2f2;
    --warning: #b45309;
    --warning-50: #fffbeb;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .15);
    --tema-marinho: #1e293b; --tema-marinho-2: #2563eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .7rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
    text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: #b8c0d2; }
.btn-dashed {
    width: 100%; background: transparent; color: var(--primary); border: 1.5px dashed #c7cbf5;
}
.btn-dashed:hover { background: var(--primary-50); border-color: var(--primary); }
.btn-sm { padding: .45rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; padding: .85rem; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.link-btn {
    background: none; border: none; color: var(--muted); font: inherit; font-size: .9rem;
    cursor: pointer; padding: 0;
}
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn.danger { color: var(--danger); margin-top: .5rem; }
.icon-btn {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); cursor: pointer; font-size: .85rem;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .8rem 2rem; background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-size: 1.1rem; text-decoration: none !important; }
.brand strong { color: var(--primary); }
.brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-weight: 800;
}
.topbar-nav { display: flex; align-items: center; gap: 1.25rem; }
.topbar-nav > a:not(.btn) { color: var(--text-2); font-weight: 500; font-size: .95rem; }
.topbar-nav > a.active { color: var(--text); font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: .6rem; padding-left: 1.25rem; border-left: 1px solid var(--border); }
.avatar {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: .9rem;
}
.user-name { font-weight: 600; font-size: .9rem; }

/* ---------- Flash / alertas ---------- */
.flash-stack { position: fixed; top: 76px; right: 1.5rem; z-index: 100; display: grid; gap: .6rem; max-width: 380px; }
.flash {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--surface);
    border: 1px solid var(--border); border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg); font-size: .92rem; animation: slide-in .25s ease-out;
    transition: opacity .4s, transform .4s;
}
.flash.fade-out { opacity: 0; transform: translateX(20px); pointer-events: none; }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: var(--danger); }
.flash-warning { border-left-color: #f59e0b; }
.flash-close { background: none; border: none; font-size: 1.2rem; line-height: 1; color: var(--muted); cursor: pointer; }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } }

.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .92rem; }
.alert ul { margin: .35rem 0 0 1.1rem; }
.alert-error { background: var(--danger-50); color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero {
    position: relative; overflow: hidden; padding: 3rem 3.5rem; color: #e0e7ff;
    display: flex; flex-direction: column; gap: 3rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(129, 140, 248, .35), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(56, 189, 248, .25), transparent 40%),
        linear-gradient(145deg, #1e1b4b, #312e81 55%, #3730a3);
}
.brand-light { color: #fff; }
.brand-light strong { color: #a5b4fc; }
.auth-hero-text h1 { font-size: 2.4rem; line-height: 1.15; color: #fff; max-width: 480px; }
.auth-hero-text p { margin-top: 1rem; max-width: 460px; color: #c7d2fe; font-size: 1.05rem; }
.auth-features { list-style: none; margin-top: 1.75rem; display: grid; gap: .7rem; }
.auth-features li { padding-left: 1.8rem; position: relative; }
.auth-features li::before {
    content: '✓'; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
    background: rgba(165, 180, 252, .2); color: #a5b4fc; font-size: .75rem; display: grid; place-items: center;
}
.auth-preview { margin-top: auto; }
.mini-cv {
    display: flex; width: 300px; height: 190px; border-radius: 10px; overflow: hidden;
    background: #fff; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); transform: rotate(-4deg);
}
.mini-side { width: 34%; background: #1e293b; padding: 14px 12px; display: flex; flex-direction: column; gap: 7px; }
.mini-photo { width: 44px; height: 44px; border-radius: 50%; background: #64748b; border: 2px solid #2563eb; align-self: center; margin-bottom: 6px; }
.mini-side i { display: block; height: 5px; border-radius: 3px; background: #475569; }
.mini-side i.s { width: 60%; }
.mini-main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.mini-main b { height: 12px; width: 70%; background: #1e293b; border-radius: 3px; }
.mini-main em { height: 7px; width: 45%; background: #2563eb; border-radius: 3px; }
.mini-main hr { border: none; height: 2px; background: #2563eb; margin-top: 6px; }
.mini-main i { height: 5px; border-radius: 3px; background: #e2e8f0; }
.mini-main i.s { width: 70%; }

.auth-form-wrap { display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.7rem; font-weight: 800; }
.auth-card > .muted { margin: .3rem 0 1.75rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: .92rem; color: var(--muted); }
.password-wrap { position: relative; }
.password-wrap input[type] { padding-right: 5rem; }
.toggle-pass {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--primary); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: .3rem .5rem;
}
.strength { height: 4px; background: var(--border); border-radius: 4px; margin-top: .5rem; overflow: hidden; }
.strength-bar { height: 100%; width: 0; transition: width .25s, background .25s; }
.strength-bar.fraca { background: var(--danger); }
.strength-bar.media { background: #f59e0b; }
.strength-bar.boa { background: #22c55e; }
.strength-bar.forte { background: var(--success); }

/* ---------- Crédito / rodapé ---------- */
.credito {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem 1rem;
    font-size: .82rem; color: var(--muted);
}
.credito strong { color: var(--text-2); font-weight: 600; }
.credito-sep { width: 1px; height: 22px; background: var(--border-strong); }
.credito-mant { display: inline-flex; align-items: center; gap: .55rem; }
.credito img { display: block; height: 36px; width: auto; }
.credito img.logo-une { height: 32px; }
.credito { flex-direction: column; gap: .7rem; }
.credito-linha { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem 1rem; }
.sac-whatsapp { display: inline-flex; align-items: center; gap: .4rem; color: #15803d; font-weight: 500; }
.sac-whatsapp strong { color: inherit; font-weight: 700; }
.sac-whatsapp svg { flex: none; color: #22c55e; }
.termos-sac .sac-whatsapp {
    padding: .65rem 1rem; border-radius: var(--radius-sm); background: #f0fdf4; border: 1px solid #bbf7d0; font-size: .95rem;
}
.termos-sac .sac-whatsapp:hover { background: #dcfce7; text-decoration: none; }
.site-footer { padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--border); }
.auth-credito { padding-top: 2rem; }

/* ---------- Menu de compartilhar ---------- */
body.sem-rolagem { overflow: hidden; }
.share-sheet { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.share-sheet[hidden] { display: none; }
.share-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); animation: fade-in .2s ease-out; }
.share-panel {
    position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius);
    padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow-lg); animation: sobe .22s ease-out;
}
.share-panel h2 { margin-bottom: .25rem; }
.share-validade { margin-bottom: 1.1rem; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.share-opt {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    padding: .85rem .3rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; text-align: center;
    text-decoration: none !important; transition: background .15s, border-color .15s;
}
.share-opt:hover { background: var(--primary-50); border-color: var(--primary); }
.share-whatsapp { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.share-whatsapp:hover { background: #dcfce7; border-color: #22c55e; }
.share-whatsapp svg { color: #22c55e; }
.share-emoji { font-size: 1.3rem; line-height: 22px; }
.share-link-field { margin-bottom: .9rem; }
.share-url { font-size: .85rem !important; color: var(--text-2) !important; background: var(--surface-2) !important; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sobe { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 680px) {
    .share-sheet { place-items: end stretch; padding: 0; }
    .share-panel { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(1.2rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .share-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Termos e consentimento ---------- */
.consentimentos { display: grid; gap: .2rem; margin: .4rem 0 1.25rem; font-size: .88rem; color: var(--text-2); }
.consentimentos .check { align-items: flex-start; margin-bottom: .55rem; line-height: 1.45; }
.consentimentos .check-box { margin-top: 1px; }
.termos { max-width: 820px; }
.termos-brand { margin: .75rem 0 1.25rem; display: flex; width: fit-content; }
.termos > h1 { margin-top: .25rem; }
.termos-indice { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.25rem 0; }
.termos-indice a {
    padding: .3rem .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
    color: var(--text-2); font-size: .82rem; font-weight: 500;
}
.termos-indice a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.termos-texto { padding-bottom: 1.4rem; line-height: 1.7; color: var(--text-2); }
.termos-texto section + section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.termos-texto h2 { color: var(--text); margin-bottom: .6rem; }
.termos-texto p + p, .termos-texto ul + p, .termos-texto p + ul { margin-top: .6rem; }
.termos-texto ul { padding-left: 1.25rem; display: grid; gap: .3rem; }
.termos-texto strong { color: var(--text); }
.termos-texto .sac-whatsapp strong { color: inherit; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.req { color: var(--danger); font-style: normal; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: .7rem .85rem; font: inherit; font-size: .95rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: #a0a9ba; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.is-invalid { border-color: var(--danger) !important; background: #fffafa !important; }
.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12) !important; }
.is-valid { border-color: #34d399 !important; }
.field-msg { font-size: .8rem; min-height: 0; }
.field-msg:empty { display: none; }
.field-msg.error { color: var(--danger); }
.field-msg.ok { color: var(--success); }
.hint { font-size: .78rem; color: var(--muted); }
.input-addon { position: relative; }
.spinner {
    position: absolute; right: .8rem; top: 50%; width: 16px; height: 16px; margin-top: -8px;
    border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.align-start { align-items: start; }

/* ---------- Páginas ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.page-wide { max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.back-link { display: inline-block; font-size: .88rem; font-weight: 500; color: var(--muted); margin-bottom: .4rem; }

.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.cv-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column;
    --c1: var(--tema-marinho); --c2: var(--tema-marinho-2);
}
.cv-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cv-card-top {
    position: relative; height: 84px; border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(120deg, var(--c1), var(--c2));
}
.cv-card-photo {
    position: absolute; left: 1.25rem; bottom: -28px; width: 60px; height: 60px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--surface); background: var(--surface-2);
}
.cv-card-photo.placeholder { display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--c1); }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.cv-card-top .badge { position: absolute; right: 1rem; top: 1rem; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.cv-card-body { padding: 2.2rem 1.25rem 1rem; flex: 1; }
.cv-card-body h3 { font-size: 1.05rem; font-weight: 700; }
.cv-card-name { color: var(--text-2); font-size: .92rem; margin: .15rem 0 .4rem; }
.cv-card-actions { display: flex; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); align-items: center; }
.cv-card-actions .btn-primary { margin-left: auto; }
.more { position: relative; }
.more summary {
    list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center;
    border-radius: 8px; color: var(--muted); font-size: 1.1rem;
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: var(--surface-2); }
.more-menu {
    position: absolute; right: 0; bottom: 110%; min-width: 150px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .35rem; z-index: 5;
}
.more-menu button {
    width: 100%; text-align: left; background: none; border: none; padding: .55rem .75rem;
    border-radius: 7px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text);
}
.more-menu button:hover { background: var(--surface-2); }
.more-menu button.danger { color: var(--danger); }
.more-menu button.danger:hover { background: var(--danger-50); }

.empty {
    text-align: center; padding: 4rem 2rem; background: var(--surface); border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.empty p { margin: .4rem auto 1.5rem; max-width: 400px; }

.pdf-frame {
    background: #525659; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
    height: calc(100vh - 230px); min-height: 600px;
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; }
.pdf-mobile {
    display: none; text-align: center; padding: 2.5rem 1.25rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.pdf-mobile p { margin: .4rem auto 1.5rem; }
.pdf-mobile .btn-row { flex-direction: column; }

/* ---------- Editor ---------- */
.editor {
    display: grid; grid-template-columns: 250px 1fr; gap: 2rem;
    max-width: 1180px; margin: 0 auto; padding: 2rem 2rem 0;
}
.editor-nav { position: sticky; top: 88px; align-self: start; }
.editor-nav nav { display: grid; gap: 2px; margin-top: 1rem; }
.editor-nav nav a {
    padding: .5rem .75rem; border-radius: 8px; color: var(--text-2); font-size: .9rem; font-weight: 500;
    text-decoration: none; border-left: 3px solid transparent;
}
.editor-nav nav a:hover { background: var(--surface); color: var(--text); }
.editor-nav nav a.active { background: var(--surface); color: var(--primary); border-left-color: var(--primary); box-shadow: var(--shadow-sm); }
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-2); margin-bottom: .5rem; }
.progress-label strong { color: var(--primary); }
.progress { height: 6px; background: var(--primary-50); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #4f46e5); transition: width .3s; border-radius: 6px; }

.editor-main { min-width: 0; padding-bottom: 6rem; }
.editor-head { margin-bottom: 1.5rem; }
.title-input {
    font-size: 1.75rem !important; font-weight: 800; letter-spacing: -.02em; padding: .2rem .4rem !important;
    margin-left: -.4rem; border-color: transparent !important; background: transparent !important;
}
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { border-color: var(--primary) !important; background: var(--surface) !important; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.6rem 1.75rem .6rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.card > h2 { margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.section-hint { margin: -.6rem 0 1rem; }

.repeat-list { display: grid; gap: 1rem; margin-bottom: 1rem; }
.repeat-empty { text-align: center; padding: 1.25rem; color: var(--muted); font-size: .92rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.repeat-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem .2rem; background: var(--surface-2); }
.repeat-item.just-added { animation: pop .3s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } }
.repeat-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.repeat-index { font-weight: 700; color: var(--primary); font-size: .9rem; }
.repeat-tools { display: flex; gap: .35rem; }
.card > .btn-dashed { margin-bottom: 1.1rem; }

.upload {
    display: grid; place-items: center; min-height: 170px; border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm); cursor: pointer; text-align: center; padding: 1rem; background: var(--surface-2);
    transition: border-color .15s, background .15s;
}
.upload:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-text { display: grid; gap: .25rem; color: var(--text-2); }
.upload-text small { color: var(--muted); }
#foto-preview { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }


.action-bar {
    position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 1.5rem 0 0; padding: 1rem 1.25rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
}
#autosave-hint.dirty::before { content: '●'; color: #f59e0b; margin-right: .4rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
    .auth { grid-template-columns: 1fr; }
    .auth-hero { padding: 2rem; gap: 1.5rem; }
    .auth-hero-text h1 { font-size: 1.8rem; }
    .auth-preview, .auth-features { display: none; }
    .editor { grid-template-columns: minmax(0, 1fr); padding: 1.25rem 1rem 0; }
    .editor-nav { position: static; }
    .editor-nav nav { display: flex; overflow-x: auto; gap: .35rem; padding-bottom: .25rem; }
    .editor-nav nav a { white-space: nowrap; border-left: none; background: var(--surface); border: 1px solid var(--border); }
}
@media (max-width: 680px) {
    html { scroll-padding-top: 130px; }
    h1 { font-size: 1.45rem; }
    /* iOS dá zoom automático em campos com fonte < 16px */
    input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
    input[type="number"], input[type="date"], select, textarea { font-size: 16px; }
    input[type="date"] { min-height: 2.85rem; -webkit-appearance: none; appearance: none; }

    .topbar { padding: .6rem 1rem; }
    .topbar-nav { gap: .6rem; }
    .topbar-nav > a:not(.btn), .user-name { display: none; }
    .user-menu { padding-left: .6rem; gap: .5rem; }
    .flash-stack { top: 64px; left: 1rem; right: 1rem; max-width: none; }

    .page { padding: 1.25rem 1rem 3rem; }
    .page-head { flex-direction: column; align-items: stretch; margin-bottom: 1.5rem; }
    .page-head > .btn { width: 100%; }
    .page-head .btn-row .btn { flex: 1; }

    .cv-grid { grid-template-columns: 1fr; }
    .cv-card:hover { transform: none; }
    .cv-card-actions { flex-wrap: wrap; padding: .85rem 1rem; }
    .cv-card-actions .btn-ghost { flex: 1; }
    .cv-card-actions .btn-primary { order: 3; flex-basis: 100%; margin-left: 0; }

    .pdf-frame, .so-desktop { display: none; }
    .pdf-mobile { display: block; }

    .editor { padding: 1rem 1rem 0; gap: 1rem; }
    .editor-nav nav { margin: .75rem -1rem 0; padding: 0 1rem .25rem; scrollbar-width: none; }
    .editor-nav nav::-webkit-scrollbar { display: none; }
    .editor-main { padding-bottom: 2rem; }
    .title-input { font-size: 1.4rem !important; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .card { padding: 1.25rem 1rem .4rem; border-radius: var(--radius-sm); }
    .repeat-item { padding: .85rem .85rem .1rem; }

    .action-bar {
        flex-direction: column; align-items: stretch; gap: .5rem;
        margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        border-radius: 0; border-left: 0; border-right: 0;
    }
    .action-bar #autosave-hint { text-align: center; }
    .action-bar .btn-row { flex-direction: column-reverse; gap: .5rem; }
    .action-bar .btn { width: 100%; }

    .auth { grid-template-rows: auto 1fr; }
    .auth-hero { padding: 1.5rem 1.25rem; gap: 1rem; }
    .auth-hero-text h1 { font-size: 1.45rem; }
    .auth-hero-text p { font-size: .95rem; margin-top: .6rem; }
    .auth-form-wrap { padding: 1.75rem 1.25rem 2.5rem; place-items: start center; }
    .auth-card h2 { font-size: 1.45rem; }
    .auth-form-wrap { grid-template-rows: auto auto; }
    .credito, .credito-autoria { flex-direction: column; gap: .5rem; }
    .credito-autoria { gap: .35rem; }
    .credito-sep { display: none; }
}
@media (max-width: 440px) {
    .topbar .brand > span:last-child { display: none; }
    .topbar-nav .btn-sm { padding: .45rem .7rem; }
}
.optional { font-size: .8rem; font-weight: 500; color: var(--muted); }

/* ---------- Escolaridade (níveis selecionáveis) ---------- */
.school-levels { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: .4rem; }
.school-level {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem .1rem;
    transition: border-color .15s, background .15s;
}
.school-level.is-checked { border-color: var(--primary); background: var(--primary-50); }
.school-level input[type="date"]:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.check { display: flex; align-items: center; gap: .65rem; cursor: pointer; margin-bottom: .8rem; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    width: 20px; height: 20px; border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface);
    display: grid; place-items: center; transition: background .15s, border-color .15s; flex: none;
}
.check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check-box::after { content: '✓'; color: #fff; font-size: .8rem; font-weight: 700; }
.check input:focus-visible + .check-box { outline: 2px solid var(--primary); outline-offset: 2px; }
#msg-escolaridade:not(:empty) { display: block; margin-bottom: 1rem; }
@media (max-width: 680px) { .school-levels { grid-template-columns: 1fr; } }

/* ---------- CNH (categorias selecionáveis) ---------- */
.cnh-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem .9rem; margin-top: .35rem; }
.cnh-options .check { margin-bottom: 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .75rem; }
.cnh-options .check:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
@media (max-width: 680px) { .cnh-options { grid-template-columns: 1fr 1fr; } }
