:root {
    --ink: #172033;
    --muted: #627089;
    --line: #d9e1ec;
    --bg: #f4f7f2;
    --panel: #ffffff;
    --brand: #16a66a;
    --brand-dark: #087449;
    --accent: #f97316;
    --danger: #dc2626;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    position: relative;
    touch-action: pan-y;
    color: var(--ink);
    background: var(--bg);
}

.hero {
    position: relative;
    display: grid;
    min-height: 100svh;
    overflow: hidden;
    padding: 28px clamp(20px, 4vw, 56px) 46px;
    color: #101416;
    background:
        linear-gradient(180deg, rgba(245, 248, 242, .1), rgba(245, 248, 242, .26) 58%, rgba(245, 248, 242, .74)),
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, .84), transparent 26%),
        linear-gradient(90deg, rgba(20, 77, 61, .28), rgba(255, 255, 255, .34), rgba(244, 145, 68, .18)),
        url("hero-temu-potensi.png"),
        linear-gradient(135deg, #d3eadf 0%, #b9ddec 45%, #f5d7a8 100%);
    background-position: center;
    background-size: cover;
}

.nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    align-self: start;
    width: min(1180px, 100%);
    margin: 0 auto;
    z-index: 1;
}

.brand {
    display: inline-flex;
    height: 54px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font-weight: 950;
    text-decoration: none;
}

.brand img {
    display: block;
    width: auto;
    max-width: 190px;
    height: 100%;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.nav-links a {
    min-width: 84px;
    padding: 12px 18px;
    border-radius: 999px;
    color: rgba(12, 18, 20, .78);
    text-align: center;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:last-child {
    color: white;
    background: #111111;
}

.hero-center {
    z-index: 1;
    align-self: center;
    justify-self: center;
    width: min(980px, 100%);
    padding: 92px 0 82px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    margin-bottom: 24px;
    padding: 9px 18px 9px 10px;
    border: 1px solid rgba(20, 28, 32, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .48);
    backdrop-filter: blur(16px);
    color: rgba(18, 25, 29, .74);
    font-size: 14px;
    font-weight: 760;
}

.badge-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    color: white;
    background: var(--brand);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 12px;
    color: #facc15;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    max-width: 980px;
    margin: 0 auto;
    font-size: clamp(48px, 7vw, 88px);
    line-height: .98;
    letter-spacing: 0;
}

h2, h3, p {
    margin-top: 0;
}

.lead {
    max-width: 700px;
    margin: 24px 0 0;
    color: rgba(18, 25, 29, .76);
    font-size: 19px;
    line-height: 1.65;
}

.hero-cta {
    display: inline-flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    margin-top: 34px;
    padding: 0 30px;
    border-radius: 14px;
    color: white;
    background: #101010;
    text-decoration: none;
    font-weight: 500;
}

.hero-stats {
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-self: center;
    align-self: end;
    width: min(720px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    background: rgba(20, 33, 38, .46);
    backdrop-filter: blur(22px);
    color: white;
    box-shadow: 0 24px 70px rgba(30, 53, 61, .22);
}

.hero-stats div {
    padding: 18px 22px;
    text-align: center;
}

.hero-stats strong {
    display: block;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1;
}

.hero-stats span {
    display: block;
    margin-top: 7px;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
}

.shell,
.summary-shell {
    width: min(1080px, calc(100% - 32px));
    margin: 42px auto 80px;
    scroll-margin-top: 24px;
}

.assessment-page {
    margin-top: 24px;
    overflow-x: clip;
}

.assessment-form,
.panel,
.submit-panel,
.wizard-meter,
.question-card,
.restore-notice {
    max-width: 100%;
    min-width: 0;
}

.assessment-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    min-width: 0;
}

.assessment-topbar .brand {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
}

.assessment-topbar .button-link {
    flex: 0 0 auto;
    width: auto;
}

.summary-shell {
    margin-top: 40px;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 36px auto 80px;
}

.panel,
.submit-panel,
.result-hero {
    margin-bottom: 22px;
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(28, 47, 79, .08);
}

.result-hero h1 {
    font-weight: 500;
    font-size: clamp(40px, 4vw, 56px);
    line-height: 1.2;
}

.wizard-meter {
    position: sticky;
    top: 14px;
    z-index: 5;
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 42px rgba(28, 47, 79, .1);
}

.wizard-meter div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-width: 0;
}

.wizard-meter strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.wizard-meter span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.wizard-meter i {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfeae3;
}

.wizard-meter b {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #7dd3a8);
    transition: width .25s ease;
}

.wizard-step {
    display: none;
}

.wizard-step.is-active {
    display: block;
    animation: stepIn .22s ease;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 8px;
    color: white;
    background: var(--danger);
}

.restore-notice {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #bfe8d0;
    border-radius: 8px;
    color: #14532d;
    background: #ecfdf3;
    font-weight: 500;
}

.restore-notice button {
    min-height: 38px;
    padding: 0 14px;
    color: #14532d;
    background: white;
    border: 1px solid #bfe8d0;
}

.section-heading {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 18px;
    margin-bottom: 26px;
}

.section-heading span {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 8px;
    color: white;
    background: var(--brand);
    font-weight: 900;
}

.section-heading h2 {
    margin-bottom: 6px;
    font-size: clamp(24px, 4vw, 34px);
    overflow-wrap: anywhere;
}

.section-heading p,
.panel > p,
.question-card p {
    color: var(--muted);
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: white;
    font: inherit;
}

.question-card {
    padding: 20px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.question-card.has-validation-error {
    border-color: #f97316;
    box-shadow: 0 12px 30px rgba(249, 115, 22, .12);
}

.question-card + .question-card {
    margin-top: 16px;
}

.question-card .question-text {
    margin-bottom: 20px;
    padding: 60px 0;
    font-size: 24px;
    font-weight: 500;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.question-meta {
    margin-bottom: 10px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
}

.scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.scale label {
    min-height: 58px;
    min-width: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.scale input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scale span {
    display: grid;
    min-height: 58px;
    place-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    overflow-wrap: anywhere;
    background: white;
    transition: .15s ease;
}

.scale input:checked + span {
    border-color: var(--brand);
    color: white;
    background: var(--brand);
    box-shadow: 0 10px 22px rgba(22, 166, 106, .18);
}

.validation-message {
    margin: 14px 0 0;
    color: #9a3412;
    font-size: 14px;
    font-weight: 500;
}

.submit-panel {
    text-align: center;
}

button,
.button-link {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: var(--brand);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid var(--line);
    color: var(--ink);
    background: white;
}

.secondary-button:hover {
    color: white;
    border-color: var(--brand-dark);
}

.wizard-actions {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 28px;
}

.wizard-actions button {
    min-width: 150px;
}

.review-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0 8px;
    text-align: left;
}

.review-list div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.review-list strong {
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
}

.review-list span {
    color: var(--muted);
}

button:hover,
.button-link:hover {
    background: var(--brand-dark);
}

.result-hero {
    color: white;
    background: linear-gradient(135deg, #0f766e, #2563eb 58%, #f97316);
}

.result-hero .lead {
    color: rgba(255, 255, 255, .88);
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.result-meta span {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .12);
}

.top-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.result-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.rank {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 10px;
    border-radius: 999px;
    color: white;
    background: var(--accent);
    font-weight: 900;
}

.result-card strong {
    display: block;
    margin-bottom: 14px;
    font-size: 34px;
}

.result-card small {
    display: block;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.recommendation-grid {
    display: grid;
    gap: 14px;
}

.recommendation-grid article {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.recommendation-grid article > span {
    width: 12px;
    border-radius: 999px;
}

.recommendation-grid h3 {
    margin-bottom: 8px;
}

.recommendation-grid p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.score-row {
    display: grid;
    grid-template-columns: minmax(160px, 240px) 1fr 64px;
    gap: 16px;
    align-items: center;
}

.score-row span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.bar {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef7;
}

.bar i {
    display: block;
    height: 100%;
}

.note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.summary-actions label {
    margin: 20px 0;
    text-align: left;
}

.summary-actions input {
    color: var(--muted);
    background: #fbfdff;
}

.email-status {
    display: grid;
    gap: 4px;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid #bfe8d0;
    border-radius: 8px;
    color: #14532d;
    background: #ecfdf3;
    text-align: left;
}

.email-status span {
    color: #33724c;
}

.email-status small {
    color: #7f1d1d;
    line-height: 1.45;
}

.email-status-sent {
    border-color: #bfe8d0;
    color: #14532d;
    background: #ecfdf3;
}

.email-status-failed {
    border-color: #fecaca;
    color: #7f1d1d;
    background: #fef2f2;
}

.email-status-logged {
    border-color: #bfdbfe;
    color: #1e3a8a;
    background: #eff6ff;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    width: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 24px;
    background: rgba(10, 20, 25, .64);
    backdrop-filter: blur(12px);
}

.loading-overlay div {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 34px;
    border-radius: 8px;
    color: white;
    background: linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(37, 99, 235, .92));
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.loading-overlay span {
    display: inline-block;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border: 4px solid rgba(255, 255, 255, .34);
    border-top-color: white;
    border-radius: 999px;
    animation: spin .8s linear infinite;
}

.loading-overlay p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, .82);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: end;
    margin-bottom: 24px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 8px;
    color: white;
    background:
        linear-gradient(120deg, rgba(15, 118, 110, .94), rgba(37, 99, 235, .86)),
        linear-gradient(135deg, #0f766e, #2563eb);
}

.admin-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-login {
    width: min(520px, 100%);
    margin: 80px auto;
}

.admin-login form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.admin-header h1 {
    margin-left: 0;
    font-size: clamp(42px, 7vw, 72px);
}

.admin-header p:not(.eyebrow) {
    max-width: 680px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .82);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.admin-stats article {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 18px 50px rgba(28, 47, 79, .08);
}

.admin-stats strong {
    display: block;
    font-size: 42px;
    line-height: 1;
}

.admin-stats span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 800;
}

.admin-top-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.admin-top-list div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.admin-top-list strong,
.admin-top-list span {
    display: block;
}

.admin-top-list span {
    margin-top: 8px;
    color: var(--muted);
}

.admin-detail-head,
.admin-table-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 22px;
}

.admin-detail-head p,
.admin-table-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

.admin-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.admin-table td span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.admin-table a {
    display: inline-flex;
    margin: 0 8px 6px 0;
    color: var(--brand-dark);
    font-weight: 900;
    text-decoration: none;
}

.email-pill {
    display: inline-flex !important;
    margin: 0;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 900;
}

.email-pill-sent {
    color: #14532d !important;
    background: #dcfce7;
}

.email-pill-failed {
    color: #7f1d1d !important;
    background: #fee2e2;
}

.email-pill-logged {
    color: #1e3a8a !important;
    background: #dbeafe;
}

.email-pill-none {
    color: var(--muted) !important;
    background: #eef3f8;
}

.health-list {
    display: grid;
    gap: 12px;
}

.health-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.health-item span {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
}

.health-item h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.health-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.health-item strong {
    max-width: 340px;
    overflow-wrap: anywhere;
    color: var(--ink);
    text-align: right;
}

.health-item-ok span {
    color: #14532d;
    background: #dcfce7;
}

.health-item-warn span {
    color: #854d0e;
    background: #fef3c7;
}

.health-item-fail span {
    color: #7f1d1d;
    background: #fee2e2;
}

code {
    padding: 3px 6px;
    border-radius: 6px;
    background: #eef3f8;
}

@media (max-width: 760px) {
    .hero {
        min-height: 100svh;
        padding: 20px 18px 28px;
    }

    .nav {
        align-items: start;
        gap: 12px;
    }

    .brand {
        height: 44px;
        padding: 0;
        font-size: 13px;
    }

    .brand img {
        max-width: 138px;
    }

    .nav-links {
        max-width: 100%;
        gap: 4px;
        padding: 0;
        overflow-x: auto;
        border-radius: 0;
    }

    .nav-links a {
        min-width: auto;
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .hero-center {
        padding: 56px 0 64px;
        text-align: left;
    }

    .hero-badge {
        align-items: flex-start;
        border-radius: 24px;
    }

    h1,
    .lead {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 28px;
    }

    .form-grid,
    .top-grid,
    .score-row,
    .review-list,
    .recommendation-grid article,
    .admin-stats,
    .admin-top-list {
        grid-template-columns: 1fr;
    }

    .recommendation-grid article > span {
        width: 100%;
        height: 8px;
    }

    .scale {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .question-card {
        padding: 16px;
    }

    .scale label,
    .scale span {
        min-height: 52px;
    }

    .section-heading {
        grid-template-columns: 1fr;
    }

    .section-heading span {
        width: 46px;
        height: 46px;
    }

    .wizard-meter div {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        align-items: start;
    }

    .wizard-meter span {
        white-space: normal;
    }

    .wizard-actions {
        display: flex;
        flex-flow: row nowrap;
        align-items: center;
    }

    .assessment-topbar {
        align-items: center;
        gap: 12px;
    }

    .wizard-actions span {
        display: none;
    }

    .wizard-actions button,
    button,
    .button-link {
        width: 100%;
    }

    .assessment-topbar .button-link {
        width: auto;
        flex: 0 0 auto;
        padding-inline: 16px;
    }

    .wizard-actions button {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }

    .restore-notice {
        display: grid;
    }

    .loading-overlay {
        padding: 16px;
    }

    .loading-overlay div {
        width: 100%;
        max-width: 420px;
        padding: 26px;
    }

    .admin-header,
    .admin-header-actions,
    .admin-detail-head,
    .admin-table-head {
        display: grid;
    }
}
