:root {
    --ink: #221f20;
    --blue: #2d3192;
    --blue-deep: #2d328c;
    --indigo: #373785;
    --green: #07673a;
    --green-deep: #1a6543;
    --paper: #f7f8f8;
    --mist: #dde3e1;
    --white: #ffffff;
    --shadow: 0 18px 50px rgba(34, 31, 32, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "DM Sans", system-ui, sans-serif;
    background: radial-gradient(1200px 480px at 10% -10%, rgba(45, 49, 146, 0.12), transparent 50%),
                radial-gradient(900px 420px at 100% 0%, rgba(7, 103, 58, 0.12), transparent 46%),
                var(--paper);
    color: var(--ink);
}

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

.navbar {
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 7%;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 4px solid var(--green);
}

.brand img {
    height: 58px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 1.4rem;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    font-weight: 500;
    letter-spacing: 0.01em;
}

main {
    width: min(1120px, 92%);
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
}

.site-footer {
    background: var(--ink);
    color: var(--mist);
    text-align: center;
    padding: 1.2rem;
    font-size: 0.9rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green);
    margin: 0 0 0.6rem;
}

h1, h2, h3 { line-height: 1.2; }

.lead { font-size: 1.08rem; color: #3a3a3a; }

.card {
    background: var(--white);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 1.8rem;
    border: 1px solid rgba(221, 227, 225, 0.9);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.2rem;
    align-items: center;
}

.hero-points {
    padding-left: 1.1rem;
    color: #3e3e3e;
}

.start-card label,
.auth-card label,
.quiz-card label {
    display: block;
    font-weight: 600;
    margin: 0.9rem 0 0.35rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid #c9d2cf;
    font: inherit;
    background: #fff;
}

input:focus {
    outline: 2px solid var(--blue);
    border-color: var(--blue);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.8rem 1.3rem;
    text-decoration: none;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    color: white;
    width: 100%;
    margin-top: 1.1rem;
}

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

.btn-ghost {
    background: var(--mist);
    color: var(--ink);
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: #8a1f1f;
    color: white;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}

.profiles-preview { margin-top: 3.5rem; }

.profile-grid,
.score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.mini-profile {
    padding: 1.2rem;
    border-radius: 18px;
    color: white;
    min-height: 150px;
}

.mini-profile.p1, .score-card.cat-1 { background: var(--blue); }
.mini-profile.p2, .score-card.cat-2 { background: var(--green); }
.mini-profile.p3, .score-card.cat-3 { background: var(--indigo); }
.mini-profile.p4, .score-card.cat-4 { background: var(--green-deep); }

.quiz-wrap { max-width: 760px; margin: 0 auto; }

.quiz-meta {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.progress {
    height: 10px;
    background: var(--mist);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.8rem 0 1.2rem;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--blue));
}

.quiz-card h1 {
    font-size: 1.45rem;
    margin-top: 0.2rem;
}

.question-kicker {
    margin: 0;
    color: var(--green);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.choices {
    border: 0;
    padding: 0;
    margin: 1.2rem 0 0;
    display: grid;
    gap: 0.7rem;
}

.choice {
    display: flex;
    cursor: pointer;
}

.choice input { display: none; }

.choice span {
    width: 100%;
    border: 1.5px solid var(--mist);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: #fbfbfb;
    transition: 0.15s ease;
}

.choice input:checked + span {
    border-color: var(--blue);
    background: rgba(45, 49, 146, 0.08);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.results-hero { margin-bottom: 1.6rem; }

.dominant-message {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blue-deep);
    background: linear-gradient(90deg, rgba(45, 49, 146, 0.1), rgba(7, 103, 58, 0.1));
    border-left: 6px solid #f4d35e;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    margin: 1.2rem 0 0;
}

.score-card {
    color: white;
    border-radius: 18px;
    padding: 1.1rem;
    position: relative;
    min-height: 150px;
}

.score-card.dominant {
    outline: 3px solid #f4d35e;
    box-shadow: 0 0 0 4px rgba(244, 211, 94, 0.35);
}

.badge {
    display: inline-block;
    background: #f4d35e;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.score-card .big {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0.4rem 0 0;
}

.profile-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.8rem;
}

.profile-full {
    background: white;
    border-radius: 18px;
    padding: 1.3rem 1.4rem;
    border-left: 8px solid var(--blue);
    box-shadow: var(--shadow);
}

.profile-full.dominant {
    background: #fff8dc;
    outline: 3px solid #f4d35e;
    box-shadow: 0 0 0 4px rgba(244, 211, 94, 0.25), var(--shadow);
}

.profile-full.cat-2 { border-left-color: var(--green); }
.profile-full.cat-3 { border-left-color: var(--indigo); }
.profile-full.cat-4 { border-left-color: var(--green-deep); }

.profile-full header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.profile-full blockquote {
    margin: 0.8rem 0 0;
    font-style: italic;
    color: var(--indigo);
}

.risk { color: var(--green-deep); }

.download-bar {
    margin-top: 2.2rem;
    text-align: center;
}

.download-bar .btn { width: auto; min-width: 280px; }

.hint { color: #666; }

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

.auth-card { width: min(420px, 100%); }

.auth-card .btn-primary { width: 100%; }

.flash-wrap { margin-bottom: 1rem; }

.flash {
    background: var(--mist);
    padding: 0.8rem 1rem;
    border-radius: 12px;
}

.flash.error, .flash.error {
    background: #f8d7d7;
    color: #6b1515;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.4rem;
}

.hero-actions, .actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.actions form { margin: 0; }

.table-wrap { overflow-x: auto; padding: 0; }

table.responses {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.responses th {
    text-align: left;
    background: var(--ink);
    color: white;
    padding: 0.85rem 0.9rem;
}

table.responses td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--mist);
    vertical-align: middle;
}

table.responses tbody tr:hover { background: #f3f7f5; }

.name-link { font-weight: 700; color: var(--blue-deep); }

.muted { color: #6b6b6b; font-size: 0.85rem; }

.empty { text-align: center; }

.back { font-weight: 700; }

@media (max-width: 900px) {
    .hero, .profile-grid, .score-grid {
        grid-template-columns: 1fr 1fr;
    }
    .navbar { padding: 0.7rem 4%; }
    .brand img { height: 46px; }
}

@media (max-width: 640px) {
    .hero, .profile-grid, .score-grid {
        grid-template-columns: 1fr;
    }
    .nav-links { gap: 0.8rem; font-size: 0.9rem; }
    .admin-hero { flex-direction: column; align-items: flex-start; }
}
