/* R2 Talentos — Estilo Principal */
:root {
    --azul:      #2563EB;
    --azul-esc:  #1e3a8a;
    --ambar:     #f59e0b;
    --cinza:     #64748b;
    --cinza-cl:  #f1f5f9;
    --branco:    #ffffff;
    --texto:     #1e293b;
    --borda:     #e2e8f0;
    --erro:      #ef4444;
    --sucesso:   #22c55e;
    /* Cores do cliente — sobrescritas via <style> inline na view */
    --cliente-primary: #2563EB;
    --cliente-accent:  #f59e0b;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cinza-cl);
    color: var(--texto);
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER PÚBLICO ─────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, var(--azul-esc) 0%, var(--azul) 100%);
    color: var(--branco);
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.site-header .inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}
.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--branco);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}
.site-header .logo img { height: 36px; }
.site-header .logo .badge {
    background: var(--ambar);
    color: #1a1a1a;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.header-cliente {
    font-size: .85rem;
    opacity: .85;
}

/* ── HERO BANNER ────────────────────────────────────── */
.hero-banner {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ── HERO HOME ──────────────────────────────────────── */
.hero-home {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cliente-primary, #1e3a8a) 0%, #0f172a 100%);
}
.hero-home img.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: .35;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.18) 0%,
        rgba(0,0,0,.10) 40%,
        rgba(0,0,0,.48) 100%
    );
}
.hero-home .hero-content {
    position: relative;
    z-index: 1;
    padding: 48px 40px;
    max-width: 600px;
}
.hero-home h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 12px;
}
.hero-home p {
    color: rgba(255,255,255,.8);
    font-size: 1.05rem;
    margin-bottom: 20px;
}
.hero-home .hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── SEÇÃO DE VAGAS ─────────────────────────────────── */
.vagas-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}
.vagas-section .section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.vagas-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.vagas-section .section-sub { color: var(--cinza); font-size: .95rem; }
.vagas-section .cta-box {
    background: var(--cinza-cl);
    border-radius: 12px;
    padding: 20px 24px;
    text-align: center;
    min-width: 220px;
}
.vagas-section .cta-box p { font-weight: 700; font-size: 1rem; margin-bottom: 10px; }

.categoria-bloco { margin-bottom: 36px; }
.categoria-titulo {
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--cinza);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--borda);
    display: flex;
    align-items: center;
    gap: 8px;
}
.categoria-titulo::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: var(--cliente-primary, var(--azul));
    border-radius: 2px;
}
.vagas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.vaga-card {
    background: var(--branco);
    border: 1.5px solid var(--borda);
    border-radius: 10px;
    padding: 18px 20px;
    transition: all .18s;
    cursor: default;
    position: relative;
}
.vaga-card:hover {
    border-color: var(--cliente-primary, var(--azul));
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}
.vaga-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 8px; color: var(--texto); }
.vaga-card .badge-vaga {
    display: inline-block;
    background: var(--cinza-cl);
    color: var(--cinza);
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.vaga-card .btn-candidatar {
    display: block;
    margin-top: 12px;
    text-align: center;
    background: var(--cliente-primary, var(--azul));
    color: #fff;
    padding: 7px 0;
    border-radius: 7px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .15s;
}
.vaga-card .btn-candidatar:hover { opacity: .85; text-decoration: none; }

/* Tags de regime/modelo/cidade na vaga */
.vaga-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.vtag {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .72rem; font-weight: 600; border-radius: 20px;
    padding: 2px 9px; letter-spacing: .02em;
}
.vtag-regime  { background: #dbeafe; color: #1e40af; }
.vtag-modelo  { background: #f0fdf4; color: #166534; }
.vtag-cidade  { background: #fef9c3; color: #854d0e; font-weight: 500; }

/* ── AREA DO CANDIDATO ──────────────────────────────── */
.candidato-wrap {
    min-height: 100vh;
    background: var(--cinza-cl);
}
.candidato-header {
    background: linear-gradient(135deg, var(--cliente-primary, var(--azul-esc)) 0%, #0f172a 100%);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.candidato-header .logo { font-weight: 800; font-size: 1rem; color: #fff; text-decoration: none; }
.candidato-header nav a {
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    margin-left: 18px;
    text-decoration: none;
}
.candidato-header nav a:hover { color: #fff; }

.candidato-content {
    max-width: 860px;
    margin: 32px auto;
    padding: 0 16px;
}
.candidato-content h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.candidato-content .sub { color: var(--cinza); margin-bottom: 24px; font-size: .9rem; }

.vagas-selecao .categoria-bloco { background: var(--branco); border-radius: 10px; padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.vagas-selecao .opcao-item { padding: 9px 0; border-bottom: 1px solid var(--borda); }
.vagas-selecao .opcao-item:last-child { border-bottom: none; }

/* ── CONTAINER PRINCIPAL ────────────────────────────── */
.container {
    max-width: 760px;
    margin: 32px auto;
    padding: 0 16px;
}
.container-wide {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
}

/* ── CARD ───────────────────────────────────────────── */
.card {
    background: var(--branco);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
    padding: 28px 32px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 6px;
}
.card-desc {
    color: var(--cinza);
    font-size: .9rem;
    margin-bottom: 20px;
}

/* ── FORMULÁRIO ─────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: 5px;
    color: var(--texto);
}
.form-group label .obrig { color: var(--erro); margin-left: 2px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--borda);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--texto);
    background: var(--branco);
    transition: border-color .2s;
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }

/* Checkboxes e Radios */
.opcoes-grupo { margin-bottom: 18px; }
.opcoes-grupo .grupo-label {
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--cinza);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--borda);
}
.opcao-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    cursor: pointer;
}
.opcao-item input[type="checkbox"],
.opcao-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--azul);
    cursor: pointer;
    flex-shrink: 0;
}
.opcao-item span { font-size: .94rem; }

/* Upload */
.upload-area {
    border: 2px dashed var(--borda);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.drag-over {
    border-color: var(--azul);
    background: rgba(37,99,235,.04);
}
.upload-area input[type="file"] { display: none; }
.upload-area .icone { font-size: 2rem; margin-bottom: 6px; }
.upload-area p { font-size: .88rem; color: var(--cinza); }
.upload-area p strong { color: var(--texto); }
.upload-nome { font-size: .85rem; color: var(--sucesso); margin-top: 8px; font-weight: 600; }

/* Obrigatório */
.nota-obrig { font-size: .82rem; color: var(--erro); margin-bottom: 16px; }

/* ── BOTÕES ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary {
    background: var(--azul);
    color: var(--branco);
}
.btn-primary:hover { background: var(--azul-esc); text-decoration: none; color: var(--branco); }
.btn-danger  { background: var(--erro); color: var(--branco); }
.btn-success { background: var(--sucesso); color: var(--branco); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--borda);
    color: var(--texto);
}
.btn-outline:hover { border-color: var(--azul); color: var(--azul); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── FLASH MESSAGES ─────────────────────────────────── */
.flash {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .92rem;
    font-weight: 500;
}
.flash-erro    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-sucesso { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.flash-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── PAINEL ADMIN ───────────────────────────────────── */
.painel-wrap { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--azul-esc);
    color: var(--branco);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: #fff;
    border-radius: 8px;
    margin: 12px 12px 4px;
}
.sidebar-logo .nome { font-weight: 700; font-size: 1rem; }
.sidebar-logo .sub  { font-size: .78rem; opacity: .7; margin-top: 2px; }
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    transition: all .15s;
    text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.ativo {
    background: rgba(255,255,255,.12);
    color: var(--branco);
    text-decoration: none;
}
.sidebar nav a .ico { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .8rem;
    opacity: .6;
}

.painel-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.painel-topbar {
    background: var(--branco);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--borda);
}
.painel-topbar h1 { font-size: 1.1rem; font-weight: 700; }
.painel-topbar .usuario { font-size: .85rem; color: var(--cinza); }
.painel-content { padding: 24px 28px; overflow-y: auto; flex: 1; }

/* ── STATS CARDS ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--branco);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    border-left: 4px solid var(--azul);
}
.stat-card.novo { border-left-color: var(--ambar); }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--texto); }
.stat-card .label { font-size: .82rem; color: var(--cinza); margin-top: 2px; }

/* ── TABELA ─────────────────────────────────────────── */
.tabela-wrap { background: var(--branco); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.07); overflow: hidden; }
.tabela-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--borda);
    gap: 12px;
    flex-wrap: wrap;
}
.tabela-header h2 { font-size: 1rem; font-weight: 700; }
.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filtros input, .filtros select {
    padding: 7px 12px;
    border: 1.5px solid var(--borda);
    border-radius: 7px;
    font-size: .88rem;
    outline: none;
    font-family: inherit;
}
.filtros input:focus, .filtros select:focus { border-color: var(--azul); }

table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--cinza-cl);
    padding: 11px 16px;
    text-align: left;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--cinza);
    border-bottom: 1px solid var(--borda);
}
tbody tr { border-bottom: 1px solid var(--borda); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--cinza-cl); }
tbody td { padding: 12px 16px; font-size: .9rem; vertical-align: middle; }
tbody td .novo-badge {
    display: inline-block;
    background: var(--ambar);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── DETALHE CANDIDATO ──────────────────────────────── */
.detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px) { .detalhe-grid { grid-template-columns: 1fr; } }
.campo-detalhe label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--cinza); }
.campo-detalhe .valor { margin-top: 4px; font-size: .95rem; }
.tags-area { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tag {
    background: #eff6ff;
    color: var(--azul);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 3px 11px;
    font-size: .82rem;
    font-weight: 600;
}

/* ── LOGIN ──────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--azul-esc) 0%, var(--azul) 100%);
    padding: 20px;
}
.login-card {
    background: var(--branco);
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .nome-sistema { font-size: 1.5rem; font-weight: 800; color: var(--azul-esc); }
.login-logo .sub { font-size: .85rem; color: var(--cinza); margin-top: 4px; }

/* ── SUCESSO ────────────────────────────────────────── */
.sucesso-wrap {
    text-align: center;
    padding: 48px 20px;
}
.sucesso-wrap .ico-ok { font-size: 4rem; margin-bottom: 16px; }
.sucesso-wrap h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
.sucesso-wrap p { color: var(--cinza); max-width: 480px; margin: 0 auto 24px; }

/* ── CARD DE IA ─────────────────────────────────────── */
.ai-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1.5px solid #e0e7ff;
}
.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(90deg, #eff6ff 0%, #f5f3ff 100%);
    border-bottom: 1px solid #e0e7ff;
}
.ai-icon { font-size: 1.1rem; color: #6366f1; }
.ai-header h3 { font-size: .95rem; font-weight: 700; color: #3730a3; flex: 1; }
.ai-badge {
    font-size: .7rem;
    font-weight: 700;
    background: #6366f1;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .04em;
}
.ai-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #6366f1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background .15s;
    line-height: 1;
}
.ai-refresh:hover { background: rgba(99,102,241,.12); }
.ai-body { padding: 20px; min-height: 80px; }
.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cinza);
    font-size: .9rem;
}
.ai-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid #e0e7ff;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-text {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--texto);
}
.ai-text p { margin-bottom: 10px; }
.ai-text p:last-child { margin-bottom: 0; }
.ai-text strong { color: #3730a3; }
.ai-erro { color: var(--erro); font-size: .9rem; }
.ai-erro a { color: var(--erro); text-decoration: underline; }

/* ── RESPONSIVO ─────────────────────────────────────── */
@media(max-width: 768px) {
    .sidebar { display: none; }
    .painel-content { padding: 16px; }
    .card { padding: 20px 16px; }
    table { font-size: .83rem; }
    thead th, tbody td { padding: 9px 10px; }
}

/* ── FOOTER ─────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: .8rem;
    color: var(--cinza);
    border-top: 1px solid var(--borda);
    margin-top: 32px;
}
.site-footer a { color: var(--cinza); }
