@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
    --green-deep:   #2D5A3D;
    --green-mid:    #4F7C59;
    --green-soft:   #7DAA6E;
    --green-pale:   #EAF3E6;
    --green-mist:   #F4FAF1;
    --cream:        #FAFAF8;
    --text-dark:    #1C2B22;
    --text-muted:   #6B7F70;
    --border:       #D8E8D2;
    --white:        #FFFFFF;
    --shadow-sm:    0 2px 12px rgba(45,90,61,0.08);
    --shadow-md:    0 8px 32px rgba(45,90,61,0.12);
    --radius-lg:    20px;
    --radius-md:    12px;
    --radius-sm:    8px;
}

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

/* Hanya override body khusus halaman prediksi lewat class wrapper,
   bukan di level html/body global agar tidak bentrok dengan app.blade.php */

/* ─── Background Blob ─── */
.bg-blob {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
}
.bg-blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #b8dba8 0%, transparent 70%);
    top: -120px; right: -80px;
}
.bg-blob-2 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #d4eecc 0%, transparent 70%);
    bottom: -80px; left: -60px;
}

/* ─── Layout ─── */
.page-wrap {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--cream);
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-dark);
    overflow: hidden;
}

/* ─── Header ─── */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}
.form-header .eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--green-soft);
    margin-bottom: 8px;
}
.form-header h2,
.form-main-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--green-deep);
    line-height: 1.2;
}

/* ─── Step Progress ─── */
.step-progress {
    display: flex;
    align-items: flex-start;
    margin-bottom: 32px;
}
.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 60px;
}
.step-dot .dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.35s ease;
    position: relative;
    z-index: 1;
}
.step-dot .dot-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.3s;
    text-align: center;
}
.step-dot.active .dot {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: white;
    box-shadow: 0 0 0 4px rgba(79,124,89,0.18);
}
.step-dot.active .dot-label { color: var(--green-mid); font-weight: 600; }
.step-dot.done .dot {
    background: var(--green-soft);
    border-color: var(--green-soft);
    color: white;
}
.step-dot.done .dot-label { color: var(--green-soft); }

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin-top: 15px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.step-line::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 0%;
    background: var(--green-soft);
    transition: width 0.5s ease;
}
.step-line.filled::after { width: 100%; }

/* ─── Card ─── */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 480px;
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
}
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-soft), var(--green-deep));
}

/* ─── Slides ─── */
.slide-container {
    position: relative;
    min-height: 260px;
}
.prediction-slide {
    position: absolute;
    top: 0; left: 0; right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.prediction-slide.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
    position: relative;
}
.prediction-slide.exit-left {
    opacity: 0;
    transform: translateX(-30px);
}

/* ─── Slide Title ─── */
.slide-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.slide-title .icon {
    width: 28px; height: 28px;
    background: var(--green-pale);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* ─── Form Fields ─── */
.field-group { margin-bottom: 18px; }
.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--green-deep);
    letter-spacing: 0.4px;
    margin-bottom: 7px;
    text-transform: uppercase;
}
.field-group input,
.field-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--green-mist);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    appearance: none;
    -webkit-appearance: none;
}
.field-group input:focus,
.field-group select:focus {
    border-color: var(--green-soft);
    box-shadow: 0 0 0 3px rgba(125,170,110,0.15);
    background: var(--white);
}
.field-group input.error,
.field-group select.error {
    border-color: #e07070;
    box-shadow: 0 0 0 3px rgba(224,112,112,0.12);
}
.field-group .select-wrap { position: relative; }
.field-group .select-wrap::after {
    content: '';
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--green-soft);
    pointer-events: none;
}
.field-error {
    font-size: 11px;
    color: #c0504e;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}
.field-error.show { display: block; }
.field-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -4px;
    margin-bottom: 6px;
    line-height: 1.4;
}
.slide-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ─── Radio Group ─── */
.radio-group { display: flex; gap: 10px; }
.radio-option { flex: 1; position: relative; }
.radio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; }
.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--green-mist);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
}
.radio-option input[type="radio"]:checked + label {
    border-color: var(--green-mid);
    background: var(--green-pale);
    color: var(--green-deep);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(79,124,89,0.12);
}
.radio-option label:hover {
    border-color: var(--green-soft);
    background: var(--white);
}

/* ─── Navigation Buttons ─── */
.form-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.btn-prev {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
}
.btn-prev:hover:not(:disabled) {
    border-color: var(--green-soft);
    color: var(--green-mid);
    transform: translateX(-2px);
}
.btn-prev:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-next {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-deep));
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(45,90,61,0.25);
}
.btn-next:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(45,90,61,0.35);
}
.btn-next:active { transform: scale(0.97); }

/* ─── Symptom Checkboxes ─── */
.symptom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.symptom-item { position: relative; }
.symptom-item input[type="checkbox"] { position: absolute; opacity: 0; width: 0; }
.symptom-item label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--green-mist);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
    min-height: 48px;
    line-height: 1.4;
}
.symptom-item input:checked + label {
    border-color: var(--green-mid);
    background: var(--green-pale);
    color: var(--green-deep);
    font-weight: 600;
}
.symptom-item label .check-box {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.symptom-item input:checked + label .check-box {
    background: var(--green-mid);
    border-color: var(--green-mid);
}
.symptom-item input:checked + label .check-box::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: 700;
}

/* ─── Result Placeholder ─── */
.result-placeholder {
    text-align: center;
    padding: 12px 0 4px;
}
.result-placeholder .result-icon {
    width: 64px; height: 64px;
    background: var(--green-pale);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.result-placeholder p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Result Prediction ─── */

.result-box {
    padding: 22px;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    background: #fffdf4;
}

.result-box.risk {
    background: linear-gradient(160deg, #fffbee 0%, #fff8e0 100%);
    border-color: #f5d97a;
}

.result-box.safe {
    background: linear-gradient(160deg, #f2fbf4 0%, #e6f7ea 100%);
    border-color: var(--green-soft);
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    border: 1px solid #f5d97a;
    color: #9a6c00;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.disease-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--green-deep);
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.result-divider {
    height: 1px;
    background: linear-gradient(90deg, #f5d97a, transparent);
    margin-bottom: 16px;
    opacity: 0.6;
}

.result-desc {
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.65;
    margin-bottom: 16px;
}

.result-tips {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(245, 217, 122, 0.5);
    border-left: 3px solid #e6a800;
    border-radius: 10px;
    padding: 13px 15px;
    margin-bottom: 16px;
}

.tips-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9a6c00;
    margin-bottom: 6px;
}

.tips-text {
    font-size: 12.5px;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

.disclaimer-line {
    height: 1px;
    background: linear-gradient(90deg, #f5d97a, transparent);
    margin-bottom: 14px;
    opacity: 0.6;
}

.result-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

.result-disclaimer p {
    margin: 0;
    flex: 1;
}

.disclaimer-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── Custom Alert Modal ─── */
.custom-alert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(28, 43, 34, 0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.custom-alert-overlay.show {
    display: flex;
}
.custom-alert-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.75rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: alertPop 0.25s ease;
}
@keyframes alertPop {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.custom-alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff8e6;
    border: 2px solid #f5c842;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}
.custom-alert-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--green-deep);
    margin-bottom: 0.5rem;
}
.custom-alert-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}
.custom-alert-btn {
    width: 100%;
    padding: 11px 0;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-deep));
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(45,90,61,0.25);
    transition: all 0.2s;
}
.custom-alert-btn:hover {
    box-shadow: 0 6px 20px rgba(45,90,61,0.35);
    transform: translateY(-1px);
}

/* ─── Tombol Apa Itu (link style) ─── */
.btn-apa-itu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--green-mid);
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin-bottom: 14px;
    transition: color 0.2s;
}
.btn-apa-itu:hover { color: var(--green-deep); }

/* ─── Kotak Indikasi Lain ─── */
.indikasi-box {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(245, 217, 122, 0.5);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.indikasi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #9a6c00;
    margin-bottom: 8px;
}
.indikasi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}
.indikasi-item + .indikasi-item {
    border-top: 1px solid rgba(245, 217, 122, 0.3);
    margin-top: 4px;
    padding-top: 8px;
}
.indikasi-name {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 600;
}
.indikasi-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* ─── Tombol Pelajari (di indikasi) ─── */
.btn-pelajari.inline {
    font-size: 11px;
    color: var(--green-mid);
    border: 1px solid var(--green-mid);
    border-radius: 20px;
    padding: 2px 9px;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s;
}
.btn-pelajari.inline:hover {
    background: var(--green-mid);
    color: white;
}

/* ─── Modal Pelajari Penyakit ─── */
.disease-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 43, 34, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.disease-modal-overlay.show {
    display: flex;
}
.disease-modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 36px 32px 32px;
    max-width: 420px;
    width: 90%;
    position: relative;
    text-align: center;
    animation: alertPop 0.25s ease;
}
.disease-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.disease-modal-close:hover { color: var(--text-dark); }
.disease-modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.disease-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-deep);
    margin-bottom: 14px;
}
.disease-modal-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    text-align: left;
}
