:root {
    --bg: #f4fbf6;
    --bg-soft: #edf7f0;
    --panel: rgba(255, 255, 255, 0.84);
    --panel-border: rgba(22, 101, 52, 0.12);
    --text: #0f172a;
    --muted: #5b6474;
    --green: #1f7a4f;
    --green-dark: #155e3b;
    --green-soft: #dff4e5;
    --shadow: 0 24px 60px rgba(18, 54, 33, 0.12);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.25), transparent 30%),
        linear-gradient(180deg, #f8fcf9 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    border-radius: 999px;
    backdrop-filter: blur(16px);
}

.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.brand span {
    display: block;
    font-size: 0.84rem;
    color: var(--muted);
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topnav a,
.badge,
.quick-link {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.page-grid,
.landing-grid {
    display: grid;
    gap: 24px;
}

.landing-grid,
.auth-layout,
.result-layout {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.single-column {
    grid-template-columns: 1fr;
}

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

.single-login-card {
    max-width: 720px;
    margin: 0 auto;
}

.single-login-card > p {
    margin-bottom: 18px;
}

.assessment-intro-panel,
.assessment-step-panel,
.assessment-form {
    max-width: 860px;
    margin: 0 auto;
}

.assessment-step-panel p {
    margin-bottom: 18px;
}

.assessment-step-form {
    margin-top: 22px;
}

.intro-actions {
    justify-content: center;
}

.hero-card,
.panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-card,
.panel {
    padding: 28px;
}

.surface-muted {
    background: linear-gradient(180deg, rgba(245, 255, 248, 0.95), rgba(255, 255, 255, 0.84));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--green-dark);
    margin-bottom: 12px;
}

h1,
h2 {
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.04;
}

h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.hero-card p,
.hero-surface p,
.result-hero p {
    max-width: 62ch;
}

.hero-actions,
.button-row,
.hero-meta,
.quick-links,
.filter-actions,
.table-actions,
.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.hero-actions,
.hero-meta,
.quick-links,
.score-list,
.distribution-list,
.mass-card-grid,
.profile-pill-list,
.score-list,
.chart-layout,
.setup-grid {
    margin-top: 20px;
}

.hero-meta span,
.mini-stat,
.question-meta,
.score-item,
.distribution-item,
.quick-link {
    color: var(--muted);
}

.hero-meta span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(223, 244, 229, 0.72);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.hero-actions-centered {
    justify-content: center;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--green) 0%, #34a853 100%);
    box-shadow: 0 16px 30px rgba(22, 101, 52, 0.18);
}

.btn-secondary {
    color: var(--green-dark);
    background: rgba(223, 244, 229, 0.9);
}

.btn-link {
    min-height: auto;
    padding: 0;
    background: transparent;
    color: var(--green-dark);
}

.btn-link.danger {
    color: #b42318;
}

.btn-large {
    width: 100%;
    min-height: 56px;
    font-weight: 700;
}

.flash,
.alert {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
}

.flash-success,
.alert.success {
    background: rgba(34, 197, 94, 0.12);
    color: #14532d;
}

.flash-error,
.alert.error {
    background: rgba(248, 113, 113, 0.12);
    color: #991b1b;
}

.flash-info,
.alert.info {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
}

.field,
.stack-form,
.inline-form,
.filter-grid,
.assessment-form,
.stat-grid,
.option-grid,
.ranking-grid {
    display: grid;
    gap: 16px;
}

.field span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.92);
}

.inline-form,
.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
}

.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
}

.stat-card strong {
    font-size: 2rem;
    font-family: "Space Grotesk", sans-serif;
}

.profile-pill-list,
.mass-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.profile-pill {
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, var(--soft), #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 16%, white);
}

.profile-pill strong {
    display: block;
    color: var(--accent);
}

.question-card h2 {
    margin-bottom: 18px;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.option-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.visual-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.choice-card {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.choice-card:hover {
    transform: translateY(-2px);
    border-color: rgba(31, 122, 79, 0.3);
}

.choice-card input {
    margin-top: 5px;
}

.choice-card strong {
    display: block;
    margin-bottom: 6px;
}

.choice-card small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

.visual-choice strong {
    font-size: 1.04rem;
}

.hint {
    margin-top: 12px;
    font-size: 0.92rem;
}

.db-detail {
    margin-top: 16px;
    font-size: 0.9rem;
    word-break: break-word;
}

.sticky-actions {
    position: sticky;
    bottom: 12px;
}

.result-hero {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--soft) 80%, white), transparent 48%),
        var(--panel);
}

.result-profile {
    display: inline-flex;
    margin-top: 12px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 800;
}

.score-list {
    display: grid;
    gap: 14px;
}

.score-item {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.score-item div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.score-item strong {
    color: var(--text);
}

.score-item span {
    font-weight: 800;
}

.score-bar {
    width: 100%;
    height: 12px;
    background: #e8eef1;
    border-radius: 999px;
    overflow: hidden;
}

.score-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.card-preview,
.mass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.profile-card-svg {
    width: min(100%, 420px);
    height: auto;
}

.mass-card .profile-card-svg {
    width: min(100%, 300px);
}

.chart-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    align-items: center;
}

.donut-chart {
    position: relative;
    width: min(260px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 22%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.donut-chart div {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

.donut-chart strong {
    display: block;
    font-size: 2rem;
    font-family: "Space Grotesk", sans-serif;
}

.distribution-list {
    display: grid;
    gap: 14px;
}

.distribution-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.distribution-item div {
    display: flex;
    gap: 12px;
    align-items: center;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    vertical-align: top;
}

th {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
}

.badge.success {
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
}

.badge.neutral {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

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

.mini-stat {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.76);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.mini-stat span {
    display: block;
    margin-bottom: 8px;
}

.mini-stat strong {
    color: var(--text);
}

.footer-note {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.footer-note-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 760px;
    padding: 14px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 14px 30px rgba(21, 128, 61, 0.08);
    backdrop-filter: blur(12px);
}

.footer-mark {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green) 0%, #86efac 100%);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.10);
}

.footer-note p {
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
}

.print-body {
    margin: 0;
    background: #fff;
}

.print-card-cut {
    width: 69.15mm;
    height: 110mm;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.print-card-cut .profile-card-svg {
    width: 69.15mm;
    height: 110mm;
}

.print-single-card,
.print-grid {
    width: 190mm;
    min-height: 277mm;
    margin: 0 auto;
    padding: 0;
}

.print-single-card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(2, 69.15mm);
    grid-auto-rows: 110mm;
    justify-content: center;
    align-content: start;
    column-gap: 8mm;
    row-gap: 8mm;
}

.print-card-item {
    display: grid;
    place-items: center;
    break-inside: avoid;
}

@media (max-width: 860px) {
    .app-shell {
        width: min(100% - 20px, 1180px);
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topnav {
        justify-content: center;
    }

    .brand {
        width: 100%;
        justify-content: center;
    }

    .panel,
    .hero-card {
        padding: 22px;
    }

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

    .footer-note-inner {
        width: 100%;
        border-radius: 24px;
        padding: 16px 18px;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: #fff;
    }

    .profile-card-svg {
        width: 100%;
        max-width: 100%;
    }
}
