/* TriPM — Prywatny kwestionariusz psychopatii */
/* Jasny motyw, zielone akcenty */

:root {
    --bg:         #f5f7f5;
    --bg-card:    #ffffff;
    --bg-input:   #e8f0e8;
    --accent:     #2e7d32;
    --accent2:    #43a047;
    --accent-light: #e8f5e9;
    --text:       #2c3e2c;
    --text-muted: #6b7b6b;
    --green:      #2e7d32;
    --yellow:     #f57f17;
    --orange:     #e65100;
    --red:        #c62828;
    --blue:       #1565c0;
    --radius:     10px;
    --shadow:     0 2px 8px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* === NAGŁÓWEK === */

header {
    text-align: center;
    padding: 40px 20px 20px;
}

header h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 8px;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

/* === NAWIGACJA === */

nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0 30px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: var(--radius);
    background: var(--bg-input);
    transition: background 0.2s, transform 0.1s;
    font-size: 0.9rem;
}

nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-1px);
}

nav a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* === PASEK POSTĘPU === */

.progress-bar-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 10px 0 5px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === PYTANIA === */

.question-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    border-left: 3px solid #ddd;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}

.question-card.answered {
    border-left-color: var(--green);
}

.question-card.unanswered-highlight {
    border-left-color: var(--red);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.question-number {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

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

.options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.options label {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.options input[type="radio"] {
    display: none;
}

.option-btn {
    display: block;
    text-align: center;
    padding: 10px 8px;
    background: var(--bg-input);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s;
    border: 2px solid transparent;
    color: var(--text);
}

.option-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent2);
}

.options input[type="radio"]:checked + .option-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* === SEKCJA SEPARATORÓW === */

.section-divider {
    text-align: center;
    margin: 30px 0 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}

.section-divider::before { left: 0; }
.section-divider::after { right: 0; }

/* === POLE ETYKIETY === */

.label-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.label-section label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.label-section input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.label-section input[type="text"]:focus {
    border-color: var(--accent);
}

/* === PRZYCISK SUBMIT === */

.submit-section {
    text-align: center;
    margin: 30px 0 50px;
}

.btn {
    display: inline-block;
    padding: 14px 40px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #fff;
}

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

.btn-primary:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: var(--accent2);
}

.btn-secondary:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--red);
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-small {
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* === WYNIKI === */

.results-container {
    margin-top: 20px;
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.result-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.score-bar-container {
    margin-bottom: 20px;
}

.score-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.score-label .name {
    font-weight: 600;
}

.score-label .value {
    color: var(--text-muted);
}

.score-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}

.score-bar-fill.low       { background: var(--green); }
.score-bar-fill.medium    { background: var(--yellow); }
.score-bar-fill.high      { background: var(--orange); }
.score-bar-fill.very-high { background: var(--red); }

.norm-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 20px;
    background: var(--text);
    opacity: 0.5;
}

.norm-marker::after {
    content: 'M';
    position: absolute;
    top: -16px;
    left: -4px;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.level-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

.level-badge.low       { background: rgba(46,125,50,0.12); color: var(--green); }
.level-badge.medium    { background: rgba(245,127,23,0.12); color: var(--yellow); }
.level-badge.high      { background: rgba(230,81,0,0.12); color: var(--orange); }
.level-badge.very-high { background: rgba(198,40,40,0.12); color: var(--red); }

.total-score {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.total-score .number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.total-score .max {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.total-score .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.z-score-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === DISCLAIMER === */

.disclaimer {
    background: rgba(245, 127, 23, 0.08);
    border: 1px solid rgba(245, 127, 23, 0.25);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 0.85rem;
    color: #7a5a00;
    line-height: 1.5;
}

.disclaimer strong {
    display: block;
    margin-bottom: 4px;
}

/* === HISTORIA === */

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.history-table thead {
    background: var(--accent-light);
}

.history-table th,
.history-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
}

.history-table th {
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.history-table tbody tr {
    border-top: 1px solid #eee;
    transition: background 0.15s;
}

.history-table tbody tr:hover {
    background: var(--accent-light);
}

.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

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

.empty-state h3 {
    margin-bottom: 10px;
}

/* === OPISY PODSKAL === */

.scale-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* === BUTTONS GROUP === */

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

/* === LOGOWANIE === */

.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-container h2 {
    color: var(--accent);
    margin-bottom: 8px;
}

.login-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.login-container .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-container .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.login-container .form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-container .form-group input:focus {
    border-color: var(--accent);
}

.login-error {
    color: var(--red);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .options {
        flex-direction: column;
    }

    .options label {
        min-width: unset;
    }

    .question-card {
        padding: 14px 16px;
    }

    .history-table th,
    .history-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    .total-score .number {
        font-size: 2.2rem;
    }

    .login-container {
        margin: 40px 16px;
        padding: 24px;
    }
}

/* === FOOTER === */

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}
