/* ==========================================================================
   KIA BEP Ads Calculator — Frontend Styles v1.1
   Layout: Hasil di atas, Form di bawah (single column stacked)
   Mengikuti standar Warna Cerah kiakrikil.com
   ========================================================================== */

/* ── Reset lokal ─────────────────────────────────────────────────────────── */
#kia-bep-wrap *,
#kia-bep-wrap *::before,
#kia-bep-wrap *::after {
	box-sizing: border-box;
}

/* ── Wrapper utama ───────────────────────────────────────────────────────── */
#kia-bep-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	max-width: 640px;
	margin: 2rem auto;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 8px 40px rgba(0,0,0,0.14);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.kia-bep-header {
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	padding: 2rem 2rem 1.75rem;
	text-align: center;
	color: #fff;
}

.kia-bep-icon {
	font-size: 2.5rem;
	line-height: 1;
	margin-bottom: 0.4rem;
}

.kia-bep-title {
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0 0 0.4rem;
	color: #fff;
	letter-spacing: -0.5px;
}

.kia-bep-subtitle {
	font-size: 0.875rem;
	color: rgba(255,255,255,0.72);
	margin: 0;
}

/* ── Body — single column, stacked ──────────────────────────────────────── */
.kia-bep-body {
	display: flex;
	flex-direction: column;
	background: #f7f8fc;
}

/* ── ZONA HASIL (atas) ───────────────────────────────────────────────────── */
.kia-bep-result-col {
	padding: 1.75rem 1.75rem 0;
	order: 1;
}

/* ── Idle State ──────────────────────────────────────────────────────────── */
.kia-bep-idle {
	text-align: center;
	padding: 1.5rem 1rem 1rem;
	color: #94a3b8;
	background: #fff;
	border-radius: 16px;
	border: 2px dashed #e2e8f0;
	margin-bottom: 0;
}

.kia-bep-idle-icon {
	font-size: 2.75rem;
	margin-bottom: 0.75rem;
	opacity: 0.45;
}

.kia-bep-idle p {
	font-size: 0.875rem;
	line-height: 1.6;
	margin: 0;
}

/* ── Hasil: Kartu BEP utama ──────────────────────────────────────────────── */
.kia-bep-results {
	padding-bottom: 0.25rem;
}

.kia-bep-card {
	border-radius: 14px;
	padding: 1.1rem 1.4rem;
	margin-bottom: 0.75rem;
}

.kia-bep-card--primary {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #fff;
	text-align: center;
	padding: 1.5rem 1.4rem;
}

.kia-bep-card-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	opacity: 0.82;
	margin-bottom: 0.4rem;
}

.kia-bep-card-value {
	font-size: 3.25rem;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -2px;
}

.kia-bep-card-value--sm {
	font-size: 1.35rem;
	letter-spacing: -0.5px;
}

.kia-bep-card-sub {
	font-size: 0.82rem;
	opacity: 0.78;
	margin-top: 4px;
}

/* ── Grid 4 kartu detail ─────────────────────────────────────────────────── */
.kia-bep-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
	margin-bottom: 0.75rem;
}

.kia-bep-card--orange { background: linear-gradient(135deg, #ff6b35, #f7931e); color: #fff; }
.kia-bep-card--green  { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.kia-bep-card--blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; }
.kia-bep-card--purple { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }

/* ── Insight / Interpretasi ──────────────────────────────────────────────── */
.kia-bep-insight {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 12px;
	padding: 0.9rem 1.1rem;
	font-size: 0.875rem;
	color: #78350f;
	margin-bottom: 0.75rem;
}

.kia-bep-insight-badge {
	display: inline-block;
	font-weight: 700;
	font-size: 0.85rem;
	margin-bottom: 0.4rem;
}

.kia-bep-insight p {
	margin: 0 0 0.4rem;
	line-height: 1.5;
}

.kia-bep-insight p:last-child { margin: 0; }

.kia-bep-insight-note {
	color: #92400e;
	font-style: italic;
}

/* ── Tombol Reset (di zona hasil, sebelum divider) ───────────────────────── */
.kia-bep-btn--ghost {
	width: 100%;
	padding: 10px 20px;
	background: transparent;
	border: 2px solid #e2e8f0;
	color: #64748b;
	border-radius: 12px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background 0.15s;
	margin-top: 0;
	margin-bottom: 0;
}

.kia-bep-btn--ghost:hover {
	background: #f1f5f9;
}

/* ── Divider antara hasil & form ─────────────────────────────────────────── */
.kia-bep-divider {
	height: 1px;
	background: #e2e8f0;
	margin: 1.5rem 1.75rem 0;
	order: 2;
}

/* ── ZONA FORM INPUT (bawah) ─────────────────────────────────────────────── */
.kia-bep-form-col {
	padding: 1.5rem 1.75rem 1.75rem;
	background: #f7f8fc;
	order: 3;
}

.kia-bep-section-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #94a3b8;
	margin-bottom: 1.1rem;
}

/* ── Field ───────────────────────────────────────────────────────────────── */
.kia-bep-field {
	margin-bottom: 1rem;
}

.kia-bep-field label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 5px;
}

/* Grid 2 kolom untuk input di desktop ───────────────────────────────────── */
.kia-bep-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}

.kia-bep-field--full {
	grid-column: 1 / -1;
}

.kia-bep-input-group {
	display: flex;
	align-items: center;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.2s;
}

.kia-bep-input-group:focus-within {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.kia-bep-prefix {
	padding: 0 10px;
	background: #f1f5f9;
	color: #64748b;
	font-size: 0.82rem;
	font-weight: 700;
	white-space: nowrap;
	border-right: 2px solid #e2e8f0;
	align-self: stretch;
	display: flex;
	align-items: center;
}

.kia-bep-input {
	flex: 1;
	border: none;
	outline: none;
	padding: 9px 11px;
	font-size: 0.9rem;
	color: #1a1a1a;
	background: transparent;
	-moz-appearance: textfield;
}

.kia-bep-input::-webkit-outer-spin-button,
.kia-bep-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
.kia-bep-tooltip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #64748b;
	font-size: 0.68rem;
	font-weight: 700;
	cursor: help;
	position: relative;
	flex-shrink: 0;
}

.kia-bep-tooltip::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #1e293b;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 400;
	padding: 8px 12px;
	border-radius: 8px;
	white-space: normal;
	width: 210px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 100;
	line-height: 1.4;
}

.kia-bep-tooltip:hover::after { opacity: 1; }

/* ── Tombol Hitung (primary) ─────────────────────────────────────────────── */
.kia-bep-btn {
	width: 100%;
	padding: 13px 20px;
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	color: #fff;
	border: none;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: transform 0.15s, box-shadow 0.15s;
	margin-top: 0.25rem;
}

.kia-bep-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(79,70,229,0.38);
}

.kia-bep-btn:active { transform: translateY(0); }

.kia-bep-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.kia-bep-btn-icon { font-size: 1.1rem; }

/* ── Error Message ───────────────────────────────────────────────────────── */
.kia-bep-error {
	margin-top: 0.65rem;
	padding: 9px 13px;
	background: #fff1f2;
	border-left: 4px solid #f43f5e;
	border-radius: 0 8px 8px 0;
	color: #be123c;
	font-size: 0.85rem;
	font-weight: 500;
	display: none;
}

.kia-bep-error.is-visible { display: block; }

/* ── Animasi masuk ───────────────────────────────────────────────────────── */
@keyframes kiaBepFadeUp {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.kia-bep-results .kia-bep-card,
.kia-bep-results .kia-bep-insight {
	animation: kiaBepFadeUp 0.3s ease both;
}

.kia-bep-results .kia-bep-card:nth-child(1) { animation-delay: 0.04s; }
.kia-bep-results .kia-bep-card:nth-child(2) { animation-delay: 0.08s; }
.kia-bep-results .kia-bep-card:nth-child(3) { animation-delay: 0.12s; }
.kia-bep-results .kia-bep-card:nth-child(4) { animation-delay: 0.16s; }
.kia-bep-results .kia-bep-insight           { animation-delay: 0.20s; }

/* ── Formula Box — selalu terbuka ────────────────────────────────────────── */
.kia-bep-formula {
	background: #f1f5f9;
	border-top: 1px solid #e2e8f0;
	padding: 1.1rem 1.75rem 1.4rem;
}

.kia-bep-formula-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: #475569;
	margin-bottom: 0.9rem;
}

.kia-bep-formula-body p {
	margin: 0 0 0.9rem;
	font-size: 0.875rem;
	color: #475569;
	line-height: 1.6;
}

.kia-bep-formula-body code {
	display: inline-block;
	background: #fff;
	border: 1px solid #cbd5e1;
	padding: 3px 9px;
	border-radius: 6px;
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 0.82rem;
	color: #0f172a;
	margin-top: 3px;
}

/* ── Responsive: layar kecil ─────────────────────────────────────────────── */
@media (max-width: 500px) {
	.kia-bep-fields-grid {
		grid-template-columns: 1fr;
	}

	.kia-bep-field--full {
		grid-column: auto;
	}

	.kia-bep-title {
		font-size: 1.35rem;
	}

	.kia-bep-card-value {
		font-size: 2.5rem;
	}

	.kia-bep-result-col,
	.kia-bep-form-col {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.kia-bep-divider {
		margin-left: 1.25rem;
		margin-right: 1.25rem;
	}
}

@media (max-width: 360px) {
	.kia-bep-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.kia-bep-results .kia-bep-card,
	.kia-bep-results .kia-bep-insight {
		animation: none;
	}
}

/* ==========================================================================
   Simulasi Lanjutan — Tab System & Cards
   ========================================================================== */

/* ── Wrapper Simulasi ────────────────────────────────────────────────────── */
.kia-sim-wrap {
	margin-top: 1rem;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
}

.kia-sim-header {
	background: linear-gradient(135deg, #0f172a, #1e293b);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
	padding: 0.7rem 1rem;
	letter-spacing: 0.5px;
}

/* ── Tab Bar ─────────────────────────────────────────────────────────────── */
.kia-sim-tabs {
	display: flex;
	overflow-x: auto;
	background: #f8fafc;
	border-bottom: 2px solid #e2e8f0;
	scrollbar-width: none;
}

.kia-sim-tabs::-webkit-scrollbar { display: none; }

.kia-sim-tab {
	flex: 0 0 auto;
	padding: 0.6rem 0.9rem;
	border: none;
	background: transparent;
	font-size: 0.78rem;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s;
}

.kia-sim-tab:hover { color: #4f46e5; }

.kia-sim-tab.is-active {
	color: #4f46e5;
	border-bottom-color: #4f46e5;
	background: #fff;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.kia-sim-panel {
	display: none;
	padding: 1.1rem 1rem;
	background: #fff;
}

.kia-sim-panel.is-active { display: block; }

.kia-sim-desc {
	font-size: 0.82rem;
	color: #64748b;
	margin: 0 0 0.9rem;
	line-height: 1.5;
}

/* ── Row input dalam panel ───────────────────────────────────────────────── */
.kia-sim-row {
	margin-bottom: 0.75rem;
}

.kia-sim-row label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 5px;
}

/* ── Tombol simulasi ─────────────────────────────────────────────────────── */
.kia-sim-btn {
	padding: 9px 20px;
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	color: #fff;
	border: none;
	border-radius: 9px;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s;
	margin-bottom: 0.9rem;
}

.kia-sim-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}

/* ── Kartu Hasil Simulasi ────────────────────────────────────────────────── */
.kia-sim-card {
	border-radius: 12px;
	padding: 1rem 1.1rem;
	margin-top: 0.5rem;
	animation: kiaBepFadeUp 0.3s ease both;
}

.kia-sim-card-title {
	font-size: 0.85rem;
	font-weight: 700;
	margin-bottom: 0.65rem;
}

.kia-sim-card-body {
	font-size: 0.85rem;
	line-height: 1.5;
}

/* Warna kartu hasil */
.kia-sim-card--green  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.kia-sim-card--blue   { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }
.kia-sim-card--orange { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }
.kia-sim-card--red    { background: #fff1f2; border: 1px solid #fecdd3; color: #881337; }
.kia-sim-card--warning,
.kia-sim-card--warning { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }

/* ── Stat Grid dalam hasil simulasi ─────────────────────────────────────── */
.kia-sim-stat-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
}

.kia-sim-stat {
	background: rgba(255,255,255,0.65);
	border-radius: 8px;
	padding: 0.5rem 0.7rem;
}

.kia-sim-stat-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	opacity: 0.7;
	margin-bottom: 3px;
}

.kia-sim-stat-value {
	font-size: 0.95rem;
	font-weight: 800;
}

.kia-sim-note {
	margin: 0.5rem 0 0;
	font-size: 0.82rem;
	font-style: italic;
	opacity: 0.85;
}

/* ── Slider (Bagaimana Jika) ─────────────────────────────────────────────── */
.kia-sim-slider-group {
	margin-bottom: 1rem;
}

.kia-sim-slider-group label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.82rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.kia-sim-pct {
	font-size: 0.85rem;
	font-weight: 800;
	color: #4f46e5;
	background: #ede9fe;
	padding: 1px 8px;
	border-radius: 20px;
}

.kia-sim-slider {
	width: 100%;
	-webkit-appearance: none;
	height: 6px;
	border-radius: 3px;
	background: linear-gradient(to right, #4f46e5 50%, #e2e8f0 50%);
	outline: none;
	cursor: pointer;
}

.kia-sim-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #4f46e5;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(79,70,229,0.4);
	cursor: pointer;
}

.kia-sim-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #4f46e5;
	border: 3px solid #fff;
	cursor: pointer;
}

.kia-sim-slider-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.7rem;
	color: #94a3b8;
	margin-top: 3px;
}

/* ── A/B Layout ──────────────────────────────────────────────────────────── */
.kia-sim-ab-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.kia-sim-ab-vs {
	font-size: 0.85rem;
	font-weight: 900;
	color: #94a3b8;
	text-align: center;
}

.kia-sim-ab-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 5px;
}

.kia-sim-ab-col--a .kia-sim-ab-label { color: #4f46e5; }
.kia-sim-ab-col--b .kia-sim-ab-label { color: #0ea5e9; }

.kia-sim-ab-compare {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
	margin-bottom: 0.65rem;
}

.kia-sim-ab-box {
	border-radius: 10px;
	padding: 0.85rem;
	text-align: center;
}

.kia-sim-ab-box--a {
	background: linear-gradient(135deg, #ede9fe, #ddd6fe);
	border: 1px solid #c4b5fd;
	color: #3730a3;
}

.kia-sim-ab-box--b {
	background: linear-gradient(135deg, #e0f2fe, #bae6fd);
	border: 1px solid #7dd3fc;
	color: #075985;
}

.kia-sim-ab-box-label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.75;
	margin-bottom: 4px;
}

.kia-sim-ab-box-bud {
	font-size: 1rem;
	font-weight: 800;
	margin-bottom: 3px;
}

.kia-sim-ab-box-bep {
	font-size: 0.78rem;
	font-weight: 600;
	opacity: 0.85;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
	.kia-sim-stat-grid {
		grid-template-columns: 1fr;
	}
	.kia-sim-ab-grid {
		grid-template-columns: 1fr;
	}
	.kia-sim-ab-vs { display: none; }
}
