:root {
    --font-base: "Manrope", "Segoe UI", sans-serif;
    --app-bg: #f3f8f8;
    --surface: #ffffff;
    --surface-soft: #f7fbfb;
    --border-soft: rgba(63, 98, 103, 0.10);
    --text-main: #1f2b2d;
    --text-muted: #6c7b7d;
    --primary: #4f9a98;
    --primary-dark: #3f7f7d;
    --primary-soft: #e5f4f4;
    --shadow-soft: 0 14px 34px rgba(33, 52, 54, 0.07);
}

body {
    min-height: 100vh;
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 500;
    background:
        radial-gradient(circle at top left, rgba(126, 190, 195, 0.14), transparent 26%),
        radial-gradient(circle at top right, rgba(202, 231, 228, 0.25), transparent 22%),
        linear-gradient(180deg, #f9fcfc 0%, var(--app-bg) 100%);
    color: var(--text-main);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-base);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

p,
li,
td,
th,
label,
input,
button,
textarea,
select {
    font-family: var(--font-base);
}

.form-label,
.form-check-label,
.table,
.btn,
.badge,
.alert,
.navbar-brand {
    letter-spacing: 0;
}

.app-body {
    background-color: var(--app-bg);
}

.app-navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 10px 28px rgba(63, 127, 125, 0.18);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.app-navbar .navbar-brand,
.app-navbar .navbar-brand:hover,
.app-navbar .navbar-brand:focus {
    color: #f7fffe;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
}

.btn-app-outline {
    color: #f7fffe;
    border-color: rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    backdrop-filter: blur(6px);
}

.btn-app-outline:hover,
.btn-app-outline:focus {
    color: var(--primary-dark);
    background: #f4fff7;
    border-color: #f4fff7;
}

.btn-app-ghost {
    color: #f7fffe;
    border-color: transparent;
    background: transparent;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
}

.btn-app-ghost:hover,
.btn-app-ghost:focus {
    color: #f7fffe;
    background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: #376d6b;
    --bs-btn-active-border-color: #376d6b;
    --bs-btn-focus-shadow-rgb: 79, 154, 152;
}

.text-bg-primary {
    background-color: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
}

.card {
    border-radius: 1.15rem;
    box-shadow: var(--shadow-soft);
}

.content-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-soft);
}

.admin-header {
    margin-bottom: 1.6rem !important;
}

.admin-title {
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 1.15;
}

.admin-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.admin-section-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
}

.admin-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 24px rgba(33, 52, 54, 0.05);
}

.admin-metric {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.admin-table th {
    font-size: 0.9rem;
    font-weight: 700;
}

.admin-table td {
    font-size: 0.95rem;
    font-weight: 500;
}

.start-form .form-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.start-form .form-control {
    min-height: 3rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    border-color: #d7e3e1;
    font-size: 0.98rem;
}

.start-form .form-control:focus {
    border-color: rgba(79, 154, 152, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(79, 154, 152, 0.12);
}

.email-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding-top: 0.2rem;
}

.email-toggle-row .form-check-input {
    width: 2.35rem;
    height: 1.35rem;
    margin-top: 0;
    border-color: rgba(79, 154, 152, 0.3);
    background-color: #dfeceb;
}

.email-toggle-row .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.email-toggle-row .form-check-input:focus {
    border-color: rgba(79, 154, 152, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(79, 154, 152, 0.14);
}

.email-toggle-row .form-check-label {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
}

.start-form .form-text {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.start-form .btn-primary {
    padding: 0.7rem 1.35rem;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 0.9rem;
}

.result-hero {
    background:
        radial-gradient(circle at top right, rgba(143, 204, 207, 0.18), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
    border: 1px solid var(--border-soft);
}

.result-kicker {
    display: inline-flex;
    margin-bottom: 0.85rem;
    padding: 0.2rem 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.result-title {
    font-size: clamp(1.85rem, 3vw, 2.3rem);
    line-height: 1.18;
    font-weight: 700;
    margin-bottom: 0;
}

.hero-highlight {
    max-width: 760px;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(79, 154, 152, 0.14);
}

.hero-highlight-title {
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #536669;
}

.result-helper {
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

.score-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.score-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(33, 52, 54, 0.10);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, #67b5b2 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.top-strategy-badge {
    background: rgba(79, 154, 152, 0.12);
    border: 1px solid rgba(79, 154, 152, 0.16);
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
}

.text-secondary {
    color: var(--text-muted) !important;
}

.lead,
.form-text {
    color: var(--text-muted);
}

.table th {
    font-weight: 700;
}

.table td {
    font-weight: 500;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid #d9e5dc;
    border-radius: 0.75rem;
    background: var(--surface-soft);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.answer-option input {
    margin: 0;
    accent-color: var(--primary);
}

.answer-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

@media (max-width: 767px) {
    .answer-grid {
        grid-template-columns: repeat(4, minmax(42px, 1fr));
    }
}

.chart-wrap {
    position: relative;
    min-height: 320px;
}

.print-only {
    display: none;
}

@media (max-width: 767px) {
    .app-navbar {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .navbar-brand {
        font-size: 1.45rem;
    }

    .btn-app-outline {
        padding: 0.42rem 0.8rem;
        font-size: 0.9rem;
    }

    .btn-app-ghost {
        padding: 0.42rem 0.8rem;
        font-size: 0.9rem;
    }

    .chart-wrap {
        min-height: 280px;
    }

    .admin-title {
        font-size: 1.6rem;
    }

    .admin-metric {
        font-size: 2.45rem;
    }
}

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

    .navbar,
    .no-print {
        display: none !important;
    }

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    body {
        background: #ffffff !important;
        font-size: 10px !important;
        line-height: 1.22;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #d9e2dc !important;
        break-inside: avoid;
        margin-bottom: 0.45rem !important;
    }

    .card-body {
        padding: 0.7rem !important;
    }

    .row {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.5rem;
    }

    .print-table-section {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .print-compact-sheet {
        margin-top: 0.1rem;
    }

    .print-answer-list {
        column-count: 2;
        column-gap: 1rem;
        padding-left: 1rem;
        margin-bottom: 0;
    }

    .print-answer-list li {
        break-inside: avoid;
        margin-bottom: 0.32rem;
    }

    .print-answer-value {
        font-weight: 700;
    }

    h1,
    .h1 {
        font-size: 1.15rem !important;
    }

    h2,
    .h2,
    .h3,
    .h4,
    .h5 {
        font-size: 0.95rem !important;
        margin-bottom: 0.35rem !important;
    }

    p,
    td,
    th,
    .table,
    .small,
    .text-secondary {
        font-size: 0.78rem !important;
        margin-bottom: 0.2rem !important;
    }

    .table > :not(caption) > * > * {
        padding: 0.32rem 0.35rem;
    }

    .border,
    .rounded {
        border-radius: 0.45rem !important;
    }

    main.py-4 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
