/* =====================================================================
   app.css — Design System compartilhado do Balcão de Empregos (PMNH)
   ---------------------------------------------------------------------
   Folha base moderna, leve e responsiva usada por TODAS as telas.
   Substitui o CSS inline duplicado em cada .aspx.
   Paleta institucional: azul #2c6cb0 (mesma do cad_empresa).
   Foco: mobile-first, touch-friendly, performance (sem libs pesadas).
   ===================================================================== */

/* ---------- Tokens / variáveis ---------- */
:root {
    --primary:        #2c6cb0;
    --primary-dark:   #1d4f80;
    --primary-light:  #eaf1fb;
    --success:        #1f9d55;
    --success-dark:   #178044;
    --warning:        #d39e00;
    --warning-dark:   #b88600;
    --danger:         #c82333;
    --info:           #17a2b8;
    --secondary:      #6c757d;

    --text:           #2d3748;
    --text-muted:     #6b7280;
    --border:         #d8dee8;
    --border-soft:    #e6ebf2;
    --bg:             #eef2f7;
    --bg-card:        #ffffff;
    --bg-soft:        #f5f8fc;

    --radius:         0.6rem;
    --radius-lg:      0.9rem;
    --radius-sm:      0.4rem;
    --shadow-sm:      0 1px 3px rgba(31, 45, 61, 0.08);
    --shadow:         0 4px 12px rgba(31, 45, 61, 0.08);
    --shadow-lg:      0 12px 28px rgba(31, 45, 61, 0.12);
    --transition:     0.2s ease;
}

/* ---------- Reset leve ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: linear-gradient(135deg, #eef2f7 0%, #e3e9f2 100%);
    background-attachment: fixed;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Tahoma, Verdana, sans-serif;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---------- Container ---------- */
.container { max-width: 1140px; }
.container-narrow { max-width: 460px; margin-inline: auto; }

/* ---------- Tipografia ---------- */
.page-title {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 1.2rem;
    position: relative;
    display: inline-block;
}
.page-title::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 3px;
    background: var(--primary);
    bottom: -8px;
    left: 20%;
    border-radius: 2px;
}

/* ---------- Cabeçalho de página ---------- */
.app-header {
    background: linear-gradient(135deg, #ffffff 0%, var(--bg-soft) 100%);
    padding: 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary);
}
.app-header h1, .app-header h2 { font-weight: 700; letter-spacing: -0.3px; margin: 0; }
.app-header .subtitle { color: var(--text-muted); margin: 0.25rem 0 0; }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    margin-bottom: 1.25rem;
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
    background: linear-gradient(90deg, var(--primary-light) 0%, #ffffff 100%);
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 0.8rem 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-header i { color: var(--primary); }
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-info,
.card-header.bg-dark { color: #fff; border-bottom-color: rgba(0,0,0,0.15); }
.card-header.bg-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important; }
.card-header.bg-success { background: linear-gradient(135deg, var(--success), var(--success-dark)) !important; }
.card-header.bg-warning { background: linear-gradient(135deg, var(--warning), var(--warning-dark)) !important; color: #fff; }
.card-header.bg-info    { background: linear-gradient(135deg, #0dcaf0, #0bacca) !important; }
.card-header.bg-dark    { background: linear-gradient(135deg, #3a4252, #2d3748) !important; }

.card-body { padding: 1.25rem; }

/* ---------- Labels / dados ---------- */
label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 0.35rem;
    display: inline-block;
}
label i { color: var(--primary); margin-right: 4px; width: 16px; text-align: center; }

.data-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.15rem; }
.data-value { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 0.9rem; word-break: break-word; }
.data-value i { color: var(--primary); margin-right: 6px; }

/* Info tile (caixinha de dado padronizada) */
.info-tile {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.8rem 0.9rem;
    height: 100%;
}

/* ---------- Formulários ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    background: #fcfdff;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.form-control:hover { border-color: #b3c0d6; }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(44, 108, 176, 0.16);
    background: #fff;
    outline: none;
}
.form-control::placeholder { color: #a0aec0; font-style: italic; }

.required-field::after { content: ' *'; color: var(--danger); font-weight: 700; }

/* Floating labels (telas de login) */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary) !important;
    font-weight: 600;
    opacity: 1;
}
.form-floating > label { color: #6b7280; }

/* ---------- Botões ---------- */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all var(--transition);
    min-height: 44px;          /* touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-dark); border-color: var(--warning-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-dark { background: #2d3748; border-color: #2d3748; }
.btn-dark:hover { background: #1a202c; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* Botão de ação grande (telas de painel) */
.action-btn {
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    width: 100%;
    margin-bottom: 0.75rem;
}

/* ---------- Badges / status ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.82rem;
}
.status-pill.active  { background: #d1f0df; color: #0f5132; }
.status-pill.inactive{ background: #fde2e2; color: #842029; }

.badge { font-weight: 600; border-radius: 50px; padding: 0.4em 0.7em; }

/* ---------- Botão Home flutuante ---------- */
.fixedButton {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1030;
}
.roundedFixedBtn {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    border: 2px solid #fff;
    transition: transform var(--transition), box-shadow var(--transition);
}
.roundedFixedBtn:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(44,108,176,0.35); }
.roundedFixedBtn img { width: 40px; height: 40px; border-radius: 50%; }
.roundedFixedBtn i { font-size: 20px; color: var(--primary); }

.home-tooltip {
    position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.8); color: #fff;
    padding: 5px 10px; border-radius: 4px; font-size: 12px;
    opacity: 0; transition: opacity var(--transition); pointer-events: none; white-space: nowrap;
}
.fixedButton:hover .home-tooltip { opacity: 1; }

/* ---------- Painel de login ---------- */
.panel-shadow {
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
    background: #fff;
    border-radius: var(--radius-lg);
}

/* ---------- Aviso / alerta discreto ---------- */
.notice {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--primary-light);
    border: 1px dashed #b6cdf0;
    border-left: 4px solid var(--primary);
    color: #3d5a80;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
}
.notice i { color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.notice b { color: var(--primary-dark); }

/* ---------- Modais ---------- */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-option {
    margin-bottom: 0.6rem;
    border-width: 2px;
    font-weight: 600;
    transition: transform var(--transition), box-shadow var(--transition);
}
.modal-option:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- GridView (cards de vaga) ---------- */
.vaga-card .card-header { flex-wrap: wrap; }

/* Utilitários responsivos ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }

/* ===== Grid de CARGOS (cards lado a lado) — cad_trabalhador_vagas =====
   O ASP.NET DataList renderiza <span id="dl" class="dl-flex-wrap" style="display:inline-block;width:100%">
   e dentro vários <span align="center" valign="top"> por item. Para que o CSS Grid consiga
   organizar os .cargo-card lado a lado, precisamos que TODOS esses wrappers desapareçam
   do fluxo (display: contents). Como o ASP.NET injeta style INLINE com display:inline-block,
   a única forma de vencer a especificidade é usar SELETORES DE ATRIBUTO + !important. */
.cargos-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 1rem !important;
    align-items: stretch !important;
    width: 100% !important;
}

/* Eliminar wrappers do DataList (span root + spans item, com e sem style inline): */
.cargos-grid #dl,
.cargos-grid #dl[style],
.cargos-grid > span[id="dl"],
.cargos-grid > span[id="dl"][style] {
    display: contents !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
}
.cargos-grid #dl > span,
.cargos-grid #dl > span[style],
.cargos-grid #dl > span[align],
.cargos-grid #dl > div,
.cargos-grid #dl > table,
.cargos-grid #dl > table > tbody,
.cargos-grid #dl > table > tbody > tr,
.cargos-grid #dl > table > tbody > tr > td {
    display: contents !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    text-align: inherit !important;
    vertical-align: inherit !important;
    float: none !important;
}
.cargos-grid .cargo-card {
    width: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
}

/* ===== Grid de TRABALHADORES (cards lado a lado) =====
   O ASP.NET GridView renderiza:
     <div>
       <table id="gvx" style="...width:100%;border-collapse:collapse;...">
         <tbody>
           <tr>
             <td align="left" valign="top" style="width:100%"> [carta aqui] </td>
           </tr>
         </tbody>
       </table>
     </div>
   Também pode ser 1 TR por card (vários TRs). Precisamos "apagar" TODOS os elementos acima do .trab-card. */
.trab-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
    gap: 1rem !important;
    align-items: stretch !important;
    width: 100% !important;
}

.trab-grid > div,
.trab-grid > div[style],
.trab-grid > span,
.trab-grid > span[style],
.trab-grid #gvx,
.trab-grid #gvx[style],
.trab-grid table,
.trab-grid table[style],
.trab-grid table > thead,
.trab-grid table > thead[style],
.trab-grid table > tbody,
.trab-grid table > tbody[style],
.trab-grid table > tfoot,
.trab-grid table > tfoot[style],
.trab-grid table > tbody > tr,
.trab-grid table > tbody > tr[style],
.trab-grid table > tbody > tr > td,
.trab-grid table > tbody > tr > td[style],
.trab-grid table > tbody > tr > td[align],
.trab-grid table > tbody > tr > td[valign] {
    display: contents !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    text-align: inherit !important;
    vertical-align: inherit !important;
    float: none !important;
    table-layout: auto !important;
}
.trab-grid .trab-card {
    width: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
}

/* Mobile-first: em telas < 460px, força 1 coluna para não ficar cards espremidos */
@media (max-width: 460px) {
    .cargos-grid { grid-template-columns: 1fr !important; }
    .trab-grid   { grid-template-columns: 1fr !important; }
}

/* Breakpoints ---------------------------------------------------------- */
@media (max-width: 992px) {
    .container { max-width: 960px; }
}

@media (max-width: 768px) {
    .container, .container-narrow { max-width: 100%; padding-inline: 14px; }
    .card-body, .panel-shadow { padding: 1rem; }
    .app-header { padding: 1rem; text-align: center; }
    .grid-2 { grid-template-columns: 1fr; }
    .action-btn { width: 100%; }
    /* telas de dado viram 2 colunas */
    .row.g-3 > [class*="col-md-"] { flex: 0 0 50%; max-width: 50%; }
}

@media (max-width: 576px) {
    body { font-size: 15px; }
    .row.g-3 > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
    .card-header { font-size: 0.95rem; }
    .roundedFixedBtn { width: 40px; height: 40px; }
    .roundedFixedBtn img { width: 34px; height: 34px; }
}

/* Acessibilidade: respeitar preferência por menos movimento */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   CAMADA DE COMPATIBILIDADE Bootstrap 4 -> 5
   ---------------------------------------------------------------------
   O projeto foi migrado para Bootstrap 5, mas algumas telas ainda usam
   classes antigas do BS4 (form-row, form-group, form-group.col-*,
   text-right, etc). Esta secao recria o comportamento dessas classes
   no BS5, para que os formulários antigos continuem funcionando com
   layout em colunas responsivo, sem precisar reescrever cada campo.
   ===================================================================== */

/* form-row: no BS4 era um flex container com colunas (gutters negativos).
   No BS5 foi removido. Recriamos como um flex wrap. */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

/* form-group: no BS4 dava margin-bottom. Recriamos como mb-3. */
.form-group {
    margin-bottom: 1rem;
}

/* Colunas dentro de form-row / form-group: restaurar o comportamento
   do grid de 12 colunas do BS4 para as classes col-md-*. */
.form-row > [class*="col-"],
.form-row > .form-group[class*="col-"],
.form-group[class*="col-md-"],
.form-group[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* Tamanhos das colunas em telas grandes (>= 768px) - comportamento col-md-* */
@media (min-width: 768px) {
    .form-row > .col-md-1,  .form-group.col-md-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
    .form-row > .col-md-2,  .form-group.col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .form-row > .col-md-3,  .form-group.col-md-3  { flex: 0 0 25%;        max-width: 25%; }
    .form-row > .col-md-4,  .form-group.col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .form-row > .col-md-5,  .form-group.col-md-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .form-row > .col-md-6,  .form-group.col-md-6  { flex: 0 0 50%;        max-width: 50%; }
    .form-row > .col-md-7,  .form-group.col-md-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .form-row > .col-md-8,  .form-group.col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .form-row > .col-md-9,  .form-group.col-md-9  { flex: 0 0 75%;        max-width: 75%; }
    .form-row > .col-md-10, .form-group.col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .form-row > .col-md-11, .form-group.col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .form-row > .col-md-12, .form-group.col-md-12 { flex: 0 0 100%;       max-width: 100%; }
}

/* col-* (extra-small, sempre aplicado) - largura percentual */
.form-row > .col-1, .form-group.col-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
.form-row > .col-2, .form-group.col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.form-row > .col-3, .form-group.col-3  { flex: 0 0 25%;        max-width: 25%; }
.form-row > .col-4, .form-group.col-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.form-row > .col-5, .form-group.col-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.form-row > .col-6, .form-group.col-6  { flex: 0 0 50%;        max-width: 50%; }
.form-row > .col-7, .form-group.col-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.form-row > .col-8, .form-group.col-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.form-row > .col-9, .form-group.col-9  { flex: 0 0 75%;        max-width: 75%; }
.form-row > .col-10, .form-group.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.form-row > .col-11, .form-group.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.form-row > .col-12, .form-group.col-12 { flex: 0 0 100%;       max-width: 100%; }

/* Compatibilidade de utilitários BS4 removidos no BS5 */
.text-right { text-align: right !important; }
.text-left  { text-align: left !important; }
.float-right { float: right !important; }
.float-left  { float: left !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.ml-2 { margin-left: 0.5rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.mr-3 { margin-right: 1rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pr-3 { padding-right: 1rem !important; }
.form-text { display: block; margin-top: 0.25rem; }
.btn-block { display: block; width: 100%; }
.custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; }
.custom-control-input { position: absolute; left: 0; z-index: -1; width: 1rem; height: 1.25rem; opacity: 0; }
.custom-control-label { position: relative; margin-bottom: 0; vertical-align: top; cursor: pointer; }
.custom-control-label::before { position: absolute; top: 0.25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem; pointer-events: none; content: ""; background-color: #fff; border: #adb5bd solid 1px; }
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--primary); border-color: var(--primary); }
.custom-checkbox .custom-control-label::after { position: absolute; top: 0.25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem; content: ""; }

