/* Reset e Variáveis */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

/* Layout Global */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.header-title h1 { font-size: 1.5rem; font-weight: 700; color: #111827; }
.header-title p { font-size: 0.875rem; color: #4b5563; }
.header-actions { display: flex; gap: 8px; align-items: center; }

.main-container { max-width: 1280px; margin: 24px auto; padding: 0 24px; }
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 1024px) {
    .main-grid { grid-template-columns: 1fr 1fr; }
}

/* Painéis e Formulários */
.panel {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}
.panel h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 16px; }
.panel p.subtitle { font-size: 0.75rem; color: #6b7280; margin-top: -12px; margin-bottom: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
}
.form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
textarea.form-control { resize: vertical; min-height: 80px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }

/* Blocos Dinâmicos */
[data-form] {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Botões */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-success { background: #16a34a; color: #fff; margin-top: 8px; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; padding: 4px 12px; font-size: 0.75rem; align-self: flex-start; }
.btn-danger:hover { background: #b91c1c; }
.btn-purple { background: #9333ea; color: #fff; width: 100%; margin-bottom: 16px; }
.btn-purple:hover { background: #7e22ce; }

/* Preview */
.preview-sticky { position: sticky; top: 88px; }
.preview-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 40px;
    min-height: 800px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.preview-section { margin-bottom: 24px; }
.preview-section h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #1a3366;
    border-bottom: 1.5px solid #1a3366;
    padding-bottom: 4px;
}
.preview-item { margin-bottom: 14px; }
.preview-item-title { font-weight: 700; font-size: 12px; }
.preview-item-subtitle { font-size: 10px; color: #666; }
.preview-text { font-size: 11px; color: #333; margin-top: 4px; white-space: pre-line; }
.skill-tag {
    display: inline-block;
    background: #eef2f7;
    border: 1px solid #d5dde8;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 10px;
}

/* ATS Validation */
.hidden { display: none !important; }
.ats-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ats-badge { padding: 4px 12px; color: #fff; font-weight: bold; border-radius: 999px; font-size: 0.875rem; }
.ats-score-good { background: #10b981; }
.ats-score-warning { background: #f59e0b; }
.ats-score-bad { background: #ef4444; }
.ats-status-pass { color: #16a34a; font-size: 0.875rem; font-weight: 500; }
.ats-status-fail { color: #ea580c; font-size: 0.875rem; font-weight: 500; }
.ats-issue { display: flex; gap: 8px; font-size: 0.875rem; margin-bottom: 6px; }
.ats-issue-critical { color: #dc2626; }
.ats-issue-high { color: #ea580c; }
.ats-issue-medium { color: #ca8a04; }
.ats-suggestion { display: flex; gap: 8px; font-size: 0.875rem; color: #2563eb; margin-bottom: 6px; }

/* Utils */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.text-center { text-align: center; }
.msg-error { color: #dc2626; padding: 24px; text-align: center; }
.msg-empty { color: #9ca3af; padding: 24px; text-align: center; }