/* ─── HIRING ASSESSMENT PLATFORM — SHARED CSS ─────────────── */

:root {
    --primary: #2563EB;
    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;
    --muted: #6B7280;
    --bg: #F9FAFB;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --text: #111827;
    --text-light: #6B7280;
    --accent: #2563EB;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.page-header {
    background: var(--accent);
    color: #fff;
    padding: 24px 16px;
    text-align: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text);
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text);
}

/* ─── INTRO SECTION ──────────────────────────────────────── */
.intro {
    text-align: center;
    padding: 32px 16px;
}

.intro h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent);
}

.intro p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 540px;
    margin: 0 auto 16px;
}

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group .required::after {
    content: ' *';
    color: var(--danger);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, opacity 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { opacity: 0.9; text-decoration: none; }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover { background: #D1D5DB; text-decoration: none; }

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

.btn-danger:hover { opacity: 0.9; }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    text-align: center;
}

.progress-bar-wrap .progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ─── QUESTIONS ──────────────────────────────────────────── */
.question-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.question-card .q-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.question-card .q-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.5;
}

.likert-group {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.likert-group label {
    flex: 1;
    text-align: center;
    cursor: pointer;
}

.likert-group input[type="radio"] {
    display: none;
}

.likert-group .likert-btn {
    display: block;
    padding: 10px 4px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--card);
    transition: all 0.15s;
    min-height: 44px;
    line-height: 1.2;
}

.likert-group input[type="radio"]:checked + .likert-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.likert-group label:hover .likert-btn {
    border-color: var(--accent);
}

.likert-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 4px 2px 0;
}

/* ─── RESULTS ────────────────────────────────────────────── */
.result-section {
    margin-bottom: 32px;
}

.result-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.result-type {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.result-type .type-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.result-type .type-details h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.result-type .type-details .score {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.result-type .type-details p {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

/* ─── BAR CHART (CSS) ────────────────────────────────────── */
.bar-chart {
    margin: 16px 0;
}

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

.bar-label {
    width: 140px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.bar-value {
    width: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ─── PAIRING CARD ───────────────────────────────────────── */
.pairing-card {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000));
    color: #fff;
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    margin-bottom: 28px;
}

.pairing-card h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #fff;
    border: none;
}

.pairing-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* ─── ADMIN ──────────────────────────────────────────────── */
.admin-login {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 16px;
}

.admin-login .card {
    text-align: center;
}

.admin-login h1 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.admin-login p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.admin-nav {
    display: flex;
    background: var(--card);
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.admin-nav a {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
}

.admin-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.admin-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

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

.admin-header h1 {
    font-size: 1.3rem;
}

.stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── TABLES ─────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}

thead {
    background: var(--bg);
}

th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:hover td {
    background: #F3F4F6;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.fit-high { color: var(--success); font-weight: 700; }
.fit-medium { color: var(--warning); font-weight: 700; }
.fit-low { color: var(--danger); font-weight: 700; }

/* Mini bar for tables */
.mini-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mini-bar-track {
    width: 60px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 4px;
}

/* ─── COMPARISON ─────────────────────────────────────────── */
.compare-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 32px;
}

/* ─── FILTERS ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: #fff;
}

/* ─── ALERTS ─────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal h3 {
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.modal .btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ─── ATTRIBUTION ────────────────────────────────────────── */
.attribution {
    margin-top: 40px;
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

/* ─── DISCLOSURE ─────────────────────────────────────────── */
.data-notice {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 12px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius);
}

/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
    .progress-bar-wrap, .btn, .admin-nav, .filter-bar, .no-print { display: none !important; }
    body { background: #fff; }
    .card, .question-card { box-shadow: none; border: 1px solid #ddd; }
    .page-header { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .container { padding: 16px 12px; }
    .page-header h1 { font-size: 1.2rem; }
    .intro h1 { font-size: 1.4rem; }
    .bar-label { width: 100px; font-size: 0.8rem; }
    .likert-group .likert-btn { padding: 8px 2px; font-size: 0.75rem; }
    .stats-bar { gap: 16px; }
    .filter-bar { flex-direction: column; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    td, th { padding: 8px 6px; font-size: 0.8rem; }
}

/* ─── ASSESSMENT-SPECIFIC ACCENTS ────────────────────────── */
.ws-accent { --accent: #7C3AED; }
.disc-accent { --accent: #0891B2; }
.bf-accent { --accent: #059669; }
