/* =====================================================================
   Sistema DISC — Design System Pragtech (ver paleta-cores.md na raiz)
   ===================================================================== */

:root {
    --pragtech-950: #06143F;
    --pragtech-900: #071A52;
    --pragtech-800: #092475;
    --pragtech-700: #0D328F;
    --pragtech-600: #1646A0;
    --pragtech-500: #2563C7;
    --pragtech-400: #3D7DD6;
    --pragtech-300: #6A9BE5;
    --pragtech-200: #A9C5F2;
    --pragtech-100: #DCE8FA;
    --pragtech-50: #F0F5FD;

    --white: #FFFFFF;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    --border: #E2E6ED;

    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(6, 20, 63, 0.06), 0 1px 3px rgba(6, 20, 63, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--pragtech-50);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--pragtech-800);
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-narrow {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Cabecalho publico / auth ---------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
}

.auth-card .logo {
    display: block;
    max-width: 160px;
    margin: 0 auto 20px;
}

.auth-card h1 {
    font-size: 18px;
    text-align: center;
    color: var(--pragtech-800);
    margin: 0 0 24px;
}

/* ---------- Formularios ---------- */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-primary);
    font-size: 14px;
}

.field input::placeholder {
    color: var(--text-muted);
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--pragtech-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 199, 0.15);
}

/* ---------- Botoes ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--pragtech-800);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--pragtech-700);
}

.btn-primary:active {
    background: var(--pragtech-950);
}

.btn-primary:disabled {
    background: var(--pragtech-200);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--pragtech-100);
    color: var(--pragtech-800);
}

.btn-secondary:hover {
    background: var(--pragtech-200);
}

.btn-outline {
    background: var(--white);
    border-color: var(--pragtech-800);
    color: var(--pragtech-800);
}

.btn-outline:hover {
    background: var(--pragtech-50);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

/* ---------- Ícones ---------- */

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--pragtech-800);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.icon-btn:hover {
    background: var(--pragtech-50);
}

.icon-btn.icon-btn-outline {
    border-color: var(--pragtech-800);
}

.icon-btn.icon-btn-outline:hover {
    background: var(--pragtech-50);
}

.icon-btn.icon-btn-primary {
    background: var(--pragtech-800);
    color: var(--white);
}

.icon-btn.icon-btn-primary:hover {
    background: var(--pragtech-700);
}

.icon-btn.icon-btn-danger {
    color: var(--danger);
}

.icon-btn.icon-btn-danger:hover {
    background: #FDECEC;
}

.icon-btn:disabled,
.icon-btn.is-disabled {
    color: var(--text-muted);
    cursor: default;
    background: transparent;
}

.icon-btn:disabled:hover,
.icon-btn.is-disabled:hover {
    background: transparent;
}

/* ---------- Alertas ---------- */

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #FDECEC;
    color: var(--danger);
    border: 1px solid #F7CACA;
}

.alert-success {
    background: #E9F8EF;
    color: var(--success);
    border: 1px solid #BEEBCF;
}

.alert-info {
    background: var(--pragtech-100);
    color: var(--pragtech-800);
    border: 1px solid var(--pragtech-200);
}

/* ---------- Painel admin ---------- */

.admin-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.admin-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--pragtech-800);
}

.admin-header .brand img {
    height: 28px;
}

.admin-header .user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.admin-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.admin-nav .container {
    display: flex;
    gap: 4px;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.admin-nav-link:hover {
    color: var(--pragtech-800);
}

.admin-nav-link.is-active {
    color: var(--pragtech-800);
    border-bottom-color: var(--pragtech-800);
}

.admin-main {
    padding: 28px 0 60px;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--pragtech-800);
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    padding: 6px 8px;
    text-decoration: none;
    display: inline-flex;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link-danger {
    color: var(--danger);
}

.form-inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.perfil-preview {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.perfil-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pragtech-50);
    border: 1px solid var(--pragtech-100);
    font-size: 11.5px;
    color: var(--pragtech-800);
}

.opcao-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--pragtech-50);
}

.opcao-row .letra-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--pragtech-800);
    color: var(--white);
    font-weight: 700;
    font-size: 13px;
}

.opcao-row select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13.5px;
    margin-top: 8px;
    background: var(--white);
    width: 100%;
}

@media (max-width: 480px) {
    .opcao-row {
        grid-template-columns: 1fr;
    }
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title-row h1 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.search-box {
    margin-bottom: 16px;
}

.search-box input {
    max-width: 320px;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data-table thead th {
    background: var(--pragtech-800);
    color: var(--white);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
}

table.data-table thead th:first-child {
    border-top-left-radius: 8px;
}

table.data-table thead th:last-child {
    border-top-right-radius: 8px;
}

table.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

table.data-table tbody tr:hover {
    background: var(--pragtech-50);
}

table.data-table tbody tr.is-link {
    cursor: pointer;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pendente {
    background: #FEF3E0;
    color: var(--warning);
}

.badge-respondido {
    background: #E9F8EF;
    color: var(--success);
}

.badge-info {
    background: var(--pragtech-100);
    color: var(--pragtech-800);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* ---------- Novo convite / link gerado ---------- */

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pragtech-50);
    border: 1px solid var(--pragtech-200);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
}

.link-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--pragtech-800);
    padding: 4px;
}

.link-box input:focus {
    outline: none;
}

/* ---------- Resultado DISC ---------- */

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.result-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--pragtech-800);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.result-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--text-primary);
}

.result-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.result-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.result-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: center;
    margin: 20px 0;
}

.radar-chart-wrap {
    display: flex;
    justify-content: center;
}

.radar-chart {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
}

@media (max-width: 720px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .radar-chart {
        max-width: 260px;
        margin: 0 auto;
    }
}

.bars {
    margin: 0;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bar-label {
    width: 120px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    background: var(--pragtech-50);
    border-radius: 999px;
    overflow: hidden;
    height: 18px;
    border: 1px solid var(--border);
}

.bar-fill {
    height: 100%;
    background: var(--pragtech-500);
    border-radius: 999px 0 0 999px;
}

.bar-fill.is-predominante {
    background: var(--pragtech-800);
}

.bar-value {
    width: 70px;
    text-align: right;
    font-size: 12.5px;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.profile-desc {
    background: var(--pragtech-50);
    border: 1px solid var(--pragtech-100);
    border-radius: 8px;
    padding: 16px 18px;
}

.profile-desc h3 {
    margin: 0 0 8px;
    color: var(--pragtech-800);
    font-size: 15px;
}

.profile-desc p {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 13.5px;
}

.profile-desc .atencao {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ---------- Fluxo publico do teste ---------- */

.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-header {
    padding: 20px 0 8px;
    text-align: center;
}

.public-header img {
    height: 32px;
}

.public-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 16px 40px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--pragtech-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--pragtech-600);
    width: 0%;
    transition: width .2s ease;
}

.progress-text {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.question-block {
    display: none;
}

.question-block.is-active {
    display: block;
}

.question-block h2 {
    font-size: 17px;
    color: var(--text-primary);
    margin: 0 0 18px;
}

.option-choice {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    background: var(--white);
    transition: border-color .15s ease, background-color .15s ease;
}

.option-choice:hover {
    border-color: var(--pragtech-300);
}

.option-choice input {
    margin-right: 10px;
}

.option-choice.is-selected {
    border-color: var(--pragtech-600);
    background: var(--pragtech-50);
}

.question-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.question-nav .btn {
    flex: 1;
}

.center-message {
    text-align: center;
    padding: 60px 20px;
}

.center-message h1 {
    color: var(--pragtech-800);
    font-size: 20px;
    margin-bottom: 10px;
}

.center-message p {
    color: var(--text-secondary);
}

.public-footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------- Responsividade ---------- */

@media (max-width: 640px) {
    .admin-header .user span.hide-mobile {
        display: none;
    }

    .page-title-row {
        align-items: flex-start;
    }

    .result-header {
        flex-wrap: wrap;
    }

    table.data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
