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

/* Source protection */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
    --bg: #FAFBFC;
    --surface: #FFFFFF;
    --text-primary: #1A2332;
    --text-secondary: #5A6577;
    --text-muted: #8E99A8;
    --border: #E8ECF1;
    --border-light: #F0F3F7;
    --accent: #5B8FB9;
    --accent-light: #5B8FB918;
    --green: #7BAE7F;
    --green-light: #7BAE7F18;
    --amber: #C4A35A;
    --amber-light: #C4A35A18;
    --red-soft: #D4756A;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== LAYOUT ========== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 1.5rem 1rem 2rem;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.landing-container {
    text-align: center;
}

/* ========== LANDING ========== */
.landing-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.success-icon {
    background: var(--green-light);
    color: var(--green);
}

.landing-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.landing-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.7;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.landing-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 2rem;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #2A3544;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-full {
    width: 100%;
    max-width: 400px;
}

/* ========== PROGRESS ========== */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 100px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 500;
}

/* ========== FORMS ========== */
.section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.75rem;
}

.input-label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.input-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.text-input.input-error {
    border-color: var(--red-soft);
    box-shadow: 0 0 0 3px rgba(212, 117, 106, 0.15);
}

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

/* ========== QUESTION CARD ========== */
.question-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.question-card.slide-in {
    animation: slideIn 0.35s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.question-context {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ========== LIKERT SCALE ========== */
.likert-scale {
    margin-top: 1rem;
}

.likert-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.likert-options {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.likert-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.likert-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}

.likert-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(91, 143, 185, 0.35);
}

/* ========== NAV BUTTONS ========== */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-buttons .btn-primary {
    margin-left: auto;
}

/* ========== DASHBOARD STYLES ========== */
.dashboard-body {
    background: var(--bg);
    min-height: 100vh;
}

.dashboard-body .screen {
    display: block;
    padding: 0;
    min-height: auto;
}

.dashboard-body .screen.active {
    display: block;
}

.dash-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dash-logo span {
    color: var(--accent);
}

.dash-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dash-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.dash-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.dash-empty h2 {
    font-family: var(--font-serif);
    margin-bottom: 0.5rem;
}

.dash-empty p {
    color: var(--text-muted);
}

/* Candidate List */
.candidate-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.candidate-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.candidate-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.candidate-card.active-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light), var(--shadow-md);
}

.candidate-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.candidate-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.candidate-score-ring {
    position: relative;
    width: 52px;
    height: 52px;
}

.candidate-score-ring svg {
    transform: rotate(-90deg);
}

.candidate-score-ring .score-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Detail Panel */
.detail-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.detail-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-header h2 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
}

.detail-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.overall-score {
    text-align: center;
}

.overall-score-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.overall-score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.25rem;
}

.detail-body {
    padding: 1.5rem;
}

/* Trait Bars */
.trait-section {
    margin-bottom: 2rem;
}

.trait-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

.trait-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trait-name {
    width: 130px;
    font-size: 0.9rem;
    font-weight: 500;
    flex-shrink: 0;
}

.trait-bar-wrap {
    flex: 1;
    height: 10px;
    background: var(--border-light);
    border-radius: 100px;
    overflow: hidden;
}

.trait-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.trait-bar.curiosity { background: var(--accent); }
.trait-bar.openMindedness { background: var(--green); }
.trait-bar.workEthic { background: var(--amber); }

.trait-pct {
    width: 40px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
}

.trait-description {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-left: 3px solid var(--border);
}

.trait-description.curiosity { border-left-color: var(--accent); }
.trait-description.openMindedness { border-left-color: var(--green); }
.trait-description.workEthic { border-left-color: var(--amber); }

/* Key Insights */
.insights-section {
    margin-bottom: 2rem;
}

.insights-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

.insight-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.insight-icon.strength {
    background: var(--green-light);
    color: var(--green);
}

.insight-icon.watch {
    background: var(--amber-light);
    color: var(--amber);
}

.insight-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.insight-content p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Interview Questions */
.interview-section {
    margin-bottom: 2rem;
}

.interview-section > h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

.interview-q {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.interview-q:last-child {
    border-bottom: none;
}

.interview-q-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.interview-q p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.interview-trait-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 0.35rem;
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

/* Response Breakdown */
.response-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.response-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

.response-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.response-item-q {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
    margin-right: 0.75rem;
}

.response-item-score {
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.response-dots {
    display: flex;
    gap: 0.35rem;
}

.response-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.response-dot.filled {
    background: var(--accent);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Delete/Action buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--red-soft);
    border-color: var(--red-soft);
    background: rgba(212, 117, 106, 0.08);
}

.dash-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ========== DASHBOARD SCREEN (embedded in index.html) ========== */
#dashboardScreen {
    padding: 0;
    min-height: 100vh;
}

#dashboardScreen.active {
    display: block;
    align-items: stretch;
}

.dashboard-wrapper {
    min-height: 100vh;
    background: var(--bg);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .landing-title {
        font-size: 1.6rem;
    }

    .question-card {
        padding: 1.5rem 1.25rem;
    }

    .likert-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .likert-options {
        gap: 0.5rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .dash-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .response-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .dash-layout {
        grid-template-columns: 360px 1fr;
        gap: 2rem;
    }
}
