:root {
    --bg: #F5ECF2;
    --bg-card: rgba(255, 255, 255, 0.82);
    --fg: #303E47;
    --muted: #A29194;
    --accent: #D25866;
    --accent-dim: rgba(210, 88, 102, 0.1);
    --cyan: #9DCFD6;
    --cyan-dim: rgba(157, 207, 214, 0.15);
    --yellow: #E9A638;
    --yellow-dim: rgba(233, 166, 56, 0.12);
    --border: rgba(162, 145, 148, 0.18);
    --card-border: rgba(255, 255, 255, 0.6);
    --shadow: 0 8px 40px rgba(48, 62, 71, 0.08);
    --shadow-hover: 0 12px 48px rgba(48, 62, 71, 0.12);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ====== ATMOSFER LATAR ====== */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 10% 15%, rgba(210, 88, 102, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 90% 85%, rgba(157, 207, 214, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(233, 166, 56, 0.04) 0%, transparent 60%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(162, 145, 148, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(162, 145, 148, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, black 10%, transparent 70%);
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: orbDrift 16s ease-in-out infinite alternate;
}

.bg-orb:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -80px;
    background: rgba(210, 88, 102, 0.06);
    filter: blur(80px);
}

.bg-orb:nth-child(2) {
    width: 260px;
    height: 260px;
    bottom: -80px;
    right: -60px;
    background: rgba(157, 207, 214, 0.07);
    filter: blur(90px);
    animation-delay: -6s;
    animation-duration: 20s;
}

.bg-orb:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 40%;
    right: 10%;
    background: rgba(233, 166, 56, 0.05);
    filter: blur(70px);
    animation-delay: -10s;
    animation-duration: 22s;
}

@keyframes orbDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20px, -15px) scale(1.06);
    }
}

/* ====== LAYOUT UTAMA ====== */
.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ====== HEADER ====== */
.app-header {
    text-align: center;
    padding: 28px 20px 0;
    animation: fadeUp 0.5s both;
}

.header-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #b8434f);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 6px 24px rgba(210, 88, 102, 0.3);
}

.app-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.4rem, 3.5vw, 1.95rem);
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.3px;
}

.app-header p {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 6px;
}

/* ====== PROGRESS ====== */
.progress-bar-wrap {
    padding: 20px 20px 0;
    animation: fadeUp 0.5s 0.1s both;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-meta .sec-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-meta .sec-count {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.progress-track {
    height: 3px;
    background: rgba(162, 145, 148, 0.15);
    border-radius: 99px;
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), #b8434f);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(210, 88, 102, 0.3);
}

/* ====== SECTION DOTS ====== */
.section-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px 0;
    animation: fadeUp 0.5s 0.15s both;
}

.sdot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(162, 145, 148, 0.1);
    color: var(--muted);
    border: 1px solid rgba(162, 145, 148, 0.15);
    transition: all 0.3s;
    font-family: 'Space Grotesk', sans-serif;
}

.sdot.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(210, 88, 102, 0.3);
}

.sdot.done {
    background: rgba(210, 88, 102, 0.1);
    color: var(--accent);
    border-color: rgba(210, 88, 102, 0.15);
}

.sline {
    width: 14px;
    height: 1.5px;
    background: rgba(162, 145, 148, 0.2);
    border-radius: 99px;
}

/* ====== CARD ====== */
.card-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 0;
}

.main-card {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s;
    padding: 25px;
}

.main-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 8;
    scrollbar-width: thin;
    scrollbar-color: rgba(162, 145, 148, 0.2) transparent;
}

.card-body::-webkit-scrollbar {
    width: 4px;
}

.card-body::-webkit-scrollbar-track {
    background: transparent;
}

.card-body::-webkit-scrollbar-thumb {
    background: rgba(162, 145, 148, 0.2);
    border-radius: 99px;
}

/* ====== TOGGLE ====== */
.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.toggle-card {
    padding: 24px 16px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(162, 145, 148, 0.15);
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.toggle-card:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(162, 145, 148, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 62, 71, 0.06);
}

.toggle-card.selected {
    background: var(--accent-dim);
    border-color: rgba(210, 88, 102, 0.35);
    box-shadow: 0 6px 24px rgba(210, 88, 102, 0.12);
}

.toggle-card .tc-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(162, 145, 148, 0.08);
    color: var(--muted);
    transition: all 0.3s;
}

.toggle-card.selected .tc-icon {
    background: rgba(210, 88, 102, 0.15);
    color: var(--accent);
}

.toggle-card .tc-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--fg);
}

.toggle-card .tc-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ====== FORM ====== */
.section-header {
    margin-bottom: 20px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--accent-dim);
    color: var(--accent);
    margin-bottom: 10px;
}

.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fg);
}

.section-header .sh-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    color: var(--fg);
}

.form-label .fl-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(162, 145, 148, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--muted);
    font-family: 'Space Grotesk', sans-serif;
    margin-top: 1px;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 6px;
    padding-left: 26px;
}

.input-row {
    position: relative;
}

.input-row .ir-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
    pointer-events: none;
}

.input-row input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: rgba(245, 236, 242, 0.5);
    border: 1.5px solid rgba(162, 145, 148, 0.18);
    border-radius: 12px;
    color: var(--fg);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    outline: none;
    transition: all 0.25s;
}

.input-row input::placeholder {
    color: rgba(162, 145, 148, 0.5);
    font-weight: 400;
    font-size: 0.85rem;
}

.input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: rgba(255, 255, 255, 0.8);
}

.input-row input.readonly {
    background: rgba(157, 207, 214, 0.08);
    border-color: rgba(157, 207, 214, 0.25);
    cursor: default;
    color: var(--fg);
}

.input-row .calc-note {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.63rem;
    color: var(--cyan);
    font-weight: 700;
    background: var(--cyan-dim);
    padding: 3px 8px;
    border-radius: 6px;
}

.category-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cat-penerimaan {
    background: var(--cyan-dim);
    color: #6bb5be;
}

.cat-pengeluaran {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ====== NAVIGASI ====== */
.nav-bar {
    flex-shrink: 0;
    padding: 12px 16px 20px;
    display: flex;
    gap: 10px;
}

.nav-btn {
    flex: 1;
    padding: 13px 16px;
    border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
}

.nav-btn:active {
    transform: scale(0.97);
}

.nb-back {
    background: rgba(162, 145, 148, 0.08);
    border: 1px solid rgba(162, 145, 148, 0.15);
    color: var(--muted);
}

.nb-back:hover {
    background: rgba(162, 145, 148, 0.14);
    color: var(--fg);
}

.nb-next {
    background: linear-gradient(135deg, var(--accent), #b8434f);
    color: #fff;
    box-shadow: 0 4px 16px rgba(210, 88, 102, 0.3);
}

.nb-next:hover {
    box-shadow: 0 6px 24px rgba(210, 88, 102, 0.4);
    transform: translateY(-1px);
}

.nb-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ====== HASIL DIAGNOSA ====== */
.result-wrap {
    padding: 24px;
}

.status-banner {
    border-radius: 18px;
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.status-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
}

.status-banner .sb-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    animation: pulseSoft 2s ease-in-out infinite;
}

@keyframes pulseSoft {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.status-banner h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    position: relative;
}

.status-banner p {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.5;
    position: relative;
    max-width: 380px;
    margin: 0 auto;
}

.sb-sehat {
    background: linear-gradient(135deg, rgba(157, 207, 214, 0.25), rgba(157, 207, 214, 0.1));
    border: 1px solid rgba(157, 207, 214, 0.3);
}

.sb-sehat .sb-icon {
    background: rgba(157, 207, 214, 0.25);
    color: #6bb5be;
}

.sb-sehat h2 {
    color: #4a9aa3;
}

.sb-sehat p {
    color: var(--fg);
}

.sb-tidak-sehat {
    background: linear-gradient(135deg, rgba(233, 166, 56, 0.25), rgba(233, 166, 56, 0.08));
    border: 1px solid rgba(233, 166, 56, 0.3);
}

.sb-tidak-sehat .sb-icon {
    background: rgba(233, 166, 56, 0.2);
    color: #c98a28;
}

.sb-tidak-sehat h2 {
    color: #c98a28;
}

.sb-tidak-sehat p {
    color: var(--fg);
}

.sb-sakit {
    background: linear-gradient(135deg, rgba(210, 88, 102, 0.2), rgba(210, 88, 102, 0.06));
    border: 1px solid rgba(210, 88, 102, 0.25);
}

.sb-sakit .sb-icon {
    background: rgba(210, 88, 102, 0.15);
    color: var(--accent);
}

.sb-sakit h2 {
    color: var(--accent);
}

.sb-sakit p {
    color: var(--fg);
}

.sb-parah {
    background: linear-gradient(135deg, rgba(48, 62, 71, 0.18), rgba(48, 62, 71, 0.06));
    border: 1px solid rgba(48, 62, 71, 0.2);
}

.sb-parah .sb-icon {
    background: rgba(48, 62, 71, 0.12);
    color: var(--fg);
}

.sb-parah h2 {
    color: var(--fg);
}

.sb-parah p {
    color: var(--fg);
    opacity: 0.8;
}

.diag-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.diag-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(162, 145, 148, 0.12);
    transition: all 0.3s;
}

.diag-card:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 16px rgba(48, 62, 71, 0.05);
}

.diag-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.diag-info {
    flex: 1;
    min-width: 0;
}

.diag-info .di-q {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--fg);
}

.diag-info .di-detail {
    font-size: 0.73rem;
    color: var(--muted);
    line-height: 1.6;
}

.diag-info .di-detail span {
    font-weight: 700;
}

.diag-badge {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-top: 2px;
}

.db-ya {
    background: rgba(157, 207, 214, 0.18);
    color: #4a9aa3;
}

.db-tidak {
    background: rgba(210, 88, 102, 0.12);
    color: var(--accent);
}

/* ====== RINGKASAN ====== */
.summary-box {
    margin-top: 20px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(162, 145, 148, 0.12);
}

.summary-box .sb-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.srow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.srow .sr-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.srow .sr-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
}

.srow .sr-val.neg {
    color: var(--accent);
}

.srow .sr-val.pos {
    color: #4a9aa3;
}

.srow.total .sr-label {
    color: var(--fg);
    font-weight: 600;
}

.srow.total .sr-val {
    font-size: 0.95rem;
}

.sdivider {
    height: 1px;
    background: rgba(162, 145, 148, 0.12);
    margin: 6px 0;
}

.btn-restart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    margin-top: 20px;
    border-radius: 14px;
    background: rgba(162, 145, 148, 0.08);
    border: 1px solid rgba(162, 145, 148, 0.15);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.25s;
}

.btn-restart:hover {
    background: rgba(162, 145, 148, 0.15);
    color: var(--fg);
}

/* ====== TOAST ====== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 11px 22px;
    border-radius: 12px;
    background: var(--fg);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(48, 62, 71, 0.25);
    z-index: 999;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ====== ANIMASI ====== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-in {
    animation: fadeUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 20px 18px 8;
    }

    .result-wrap {
        padding: 20px 18px;
    }

    .toggle-grid {
        gap: 10px;
    }

    .toggle-card {
        padding: 18px 12px;
    }
}