/* PPC - Formulário - Tema escuro */
:root {
    --header-bg: #0b1120;
    --page-bg: #080c17;
    --card-bg: #151e32;
    --card-header-bg: #111827;
    --text-primary: #ffffff;
    --text-muted: #94a3b8;
    --btn-voltar-bg: #1e293b;
    --btn-salvar-bg: #10b981;
    --border-radius: 16px;
    --gap: 1.5rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--page-bg);
    background-image: radial-gradient(circle at 50% -20%, #1a2744 0%, var(--page-bg) 60%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.page-header {
    background-color: var(--header-bg);
    padding: 1rem 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.page-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Botão Sair (logout) */
.btn-sair {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.btn-sair:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-bottom-color: var(--btn-salvar-bg);
}

.btn-sair-icon {
    width: 20px;
    height: 20px;
}

/* Main content - grid 2 colunas */
.main-content {
    flex: 1;
    padding: var(--gap);
    display: flex;
    flex-direction: column;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    align-content: start;
    justify-content: center;
}

.dash-card {
    position: relative;
    background: linear-gradient(145deg, var(--card-bg), #1a253a);
    border-radius: var(--border-radius);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-primary);
    padding: 2rem;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    background: linear-gradient(145deg, #1c2742, var(--card-bg));
}

.dash-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}

.dash-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
    line-height: 1.4;
}

/* Dashboard Softskills Card */
.dash-card-softskills {
    margin: 0 1rem 1rem 1rem;
    min-height: auto;
    cursor: default;
    /* Não é clicável para abrir modal */
    align-items: flex-start;
}

.dash-card-softskills:hover {
    transform: none;
    /* Remove efeito de hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
    background: linear-gradient(145deg, var(--card-bg), #1a253a);
}

.checkbox-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    width: 100%;
}

.mt-3 {
    margin-top: 1rem;
}

/* Modal / Popup Gigante */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--page-bg);
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    background-color: var(--card-header-bg);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-close-modal svg {
    width: 24px;
    height: 24px;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Esconder sections dentro do modal por padrão */
.modal-section {
    display: none;
    border: none;
    box-shadow: none;
    background: transparent;
}

.modal-section.active {
    display: flex;
    /* O card em si já é um flex container */
}

/* Ajustes para o card dentro do modal (remover bordas duplas) */
.modal-section .card-title {
    display: none;
    /* Esconde o título do card, pois usaremos o modal-title */
}

.modal-footer {
    padding: 1.25rem 2rem;
    display: flex;
    gap: 1rem;
    background-color: var(--card-header-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: flex-end;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
    margin: 0;
    padding: 1rem 1.25rem;
    background-color: var(--card-header-bg);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-body.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.card-body--stacked {
    gap: 0;
    padding: 0;
}

/* Accordion: seções recolhíveis para muitos textareas */
.card--accordion .accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card--accordion .accordion-item:last-child {
    border-bottom: none;
}

.accordion-trigger {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s ease;
}

.accordion-trigger::-webkit-details-marker {
    display: none;
}

.accordion-trigger::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.5rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.accordion-item[open] .accordion-trigger::after {
    transform: rotate(-135deg);
}

.accordion-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    padding: 0.5rem 1rem 1rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
}

.accordion-content .field-group {
    margin-top: 0.75rem;
}

.accordion-content .field-group:first-child {
    margin-top: 0;
}

/* Sub-itens (1.4.1, 1.4.2, 1.4.3) com indentação */
.field-group--sub {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--card-header-bg);
}

.field-group--sub .field-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .card-body.grid-2x2 {
        grid-template-columns: 1fr;
    }

    .field-group--sub {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* Field groups */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.field-label--small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-group--block + .field-group--block {
    margin-top: 0.75rem;
}

.textarea-wrapper {
    position: relative;
}

.textarea-wrapper textarea {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem;
    padding-bottom: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    overflow-y: hidden;
    /* Remove barra de rolagem já que vai auto-expandir */
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.textarea-wrapper textarea:focus {
    outline: none;
    border-color: var(--btn-salvar-bg);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Expand textarea button */
.btn-expand-textarea {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: auto;
    /* Garante que é clicável por cima do textarea */
}

.btn-expand-textarea:hover {
    background: rgba(16, 185, 129, 0.2);
    color: var(--btn-salvar-bg);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-expand-textarea svg {
    width: 14px;
    height: 14px;
}

/* Modal Gigante do Textarea */
.modal-container--large {
    max-width: 1000px;
    height: 80vh;
}

.modal-content--no-pad {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.textarea-wrapper--expanded {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.textarea-wrapper--expanded textarea {
    flex: 1;
    height: 100% !important;
    min-height: 200px;
    resize: none;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.5;
    padding-bottom: 2rem;
}

.char-count {
    position: absolute;
    bottom: 0.35rem;
    right: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-count.over-limit {
    color: #ef5350;
}

/* Cenário e CHACE - tags */
.chace-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chace-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--card-header-bg);
}

/* Footer - botões */
.page-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--card-header-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: space-between;
}

.footer-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

/* Painel de alterações no footer */
.changes-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.changes-summary-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--btn-salvar-bg);
    flex-shrink: 0;
}

#changes-summary-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Textarea com alteração: borda esquerda verde */
.textarea-modified {
    position: relative;
}

.textarea-modified textarea {
    border-left: 3px solid var(--btn-salvar-bg) !important;
    background-color: rgba(16, 185, 129, 0.04) !important;
}

/* Badge de alterações no card do dashboard */
.change-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--btn-salvar-bg);
    color: #0b1120;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* Card do dashboard com alterações: borda verde sutil */
.dash-card--modified {
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}


.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn-voltar {
    background-color: var(--btn-voltar-bg);
}

.btn-voltar:hover {
    filter: brightness(1.15);
}

.btn-salvar {
    background-color: var(--btn-salvar-bg);
}

.btn-salvar:hover {
    filter: brightness(1.15);
}