/* Halaman home (app/Views/module/home/index.php). Dimuat lewat var_custom_css di Home::index. */

:root {
	--hm-green: #72c02c;
	--hm-green-dark: #4c8a1e;
	--hm-forest: #1f3a2a;
	--hm-ink: #1f2d24;
	--hm-muted: #6b7280;
	--hm-line: #e6e8eb;
	--hm-bg-alt: #f6f8f7;
	--hm-up: #1f9d55;
	--hm-down: #d64545;
	--hm-radius: 12px;
}

.up { color: var(--hm-up); }
.dn { color: var(--hm-down); }
.good { color: var(--hm-green-dark); }

/* ---------- B. Pita pasar ---------- */
.hm-strip { background: var(--hm-forest); color: #cfe3d4; font-size: 13px; overflow: hidden; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,.08); }
.hm-strip-track { display: inline-flex; animation: hm-geser 60s linear infinite; }
.hm-strip:hover .hm-strip-track { animation-play-state: paused; }
.hm-strip-list { display: flex; list-style: none; margin: 0; padding: 0; }
.hm-strip-list li { padding: 8px 18px; border-right: 1px solid rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.hm-strip-list b { color: #fff; font-weight: 600; margin-right: 4px; }
.hm-strip-list a { color: inherit; text-decoration: none; }
.hm-strip-list a:hover b { color: var(--hm-green); }
.hm-strip .up { color: #6fdc8c; }
.hm-strip .dn { color: #ff8a8a; }
@keyframes hm-geser { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.hm-strip { overflow-x: auto; }
	.hm-strip-track { animation: none; }
}

/* ---------- A. Hero ---------- */
.hm-hero {
	position: relative; color: #fff; padding: 64px 0 72px;
	background:
		linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
		linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
		linear-gradient(135deg, #142319 0%, #1f3a2a 55%, #2d5a3a 100%);
}
.hm-eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--hm-green); margin-bottom: 14px; }
.hm-hero h1 { color: #fff; font-size: 34px; line-height: 1.25; font-weight: 700; margin-bottom: 16px; }
.hm-lead { color: #c9d9cd; font-size: 17px; margin-bottom: 26px; max-width: 560px; }

.hm-search { display: flex; max-width: 580px; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.hm-search .form-control { border: 0; font-size: 16px; height: 48px; box-shadow: none; }
.hm-search .btn { background: var(--hm-green); color: #fff; border-radius: 9px; width: 56px; font-size: 18px; }
.hm-search .btn:hover { background: var(--hm-green-dark); }
/* dropdown bootstrap-autocomplete tetap di atas hero */
.hm-search .dropdown-menu { z-index: 1050; }

.hm-quick { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.hm-quick span { color: #9fb7a5; }
.hm-quick a { color: #e6f0e8; border: 1px solid rgba(255,255,255,.22); border-radius: 16px; padding: 3px 11px; text-decoration: none; }
.hm-quick a:hover { border-color: var(--hm-green); color: #fff; background: rgba(114,192,44,.15); }

.hm-hero-card {
	display: block; background: rgba(255,255,255,.97); color: var(--hm-ink); border-radius: 16px; padding: 22px;
	box-shadow: 0 20px 50px rgba(0,0,0,.35); text-decoration: none; transition: transform .2s;
}
.hm-hero-card:hover { color: var(--hm-ink); text-decoration: none; transform: translateY(-3px); }
.hm-hero-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--hm-green-dark); }
.hm-hero-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 6px 0 4px; }
.hm-hero-card-head b { font-size: 24px; display: block; }
.hm-hero-card-head small { color: var(--hm-muted); }
.hm-hero-card-price { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-hero-card-price span { font-size: 15px; font-weight: 600; margin-left: 6px; }
.hm-hero-card .hm-spark { height: 56px; margin: 8px 0 14px; }

.hm-fair-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--hm-muted); margin-bottom: 4px; }
.hm-fair svg { width: 100%; height: 10px; display: block; margin-bottom: 8px; }
.hm-fair .track { fill: #e9ecef; }
.hm-fair .fill { fill: var(--hm-green); }
.hm-fair .mark { fill: var(--hm-ink); }
.hm-fair strong { font-size: 14px; }

/* ---------- Section umum (H) ---------- */
.hm-section { padding: 56px 0 32px; }
.hm-alt { background: var(--hm-bg-alt); }
.hm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.hm-head h2 { font-size: 24px; font-weight: 700; color: var(--hm-ink); margin: 0 0 4px; }
.hm-head p { color: var(--hm-muted); margin: 0; }
.hm-head > a { color: var(--hm-green-dark); font-weight: 600; white-space: nowrap; text-decoration: none; }
.hm-head > a:hover { color: var(--hm-green); }

/* ---------- C. Kartu saham ---------- */
.hm-card {
	display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--hm-line); border-radius: var(--hm-radius);
	padding: 18px; color: var(--hm-ink); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.hm-card:hover { color: var(--hm-ink); text-decoration: none; border-color: var(--hm-green); box-shadow: 0 8px 24px rgba(31,58,42,.1); transform: translateY(-2px); }
.hm-card-top { display: flex; align-items: center; gap: 12px; }
.hm-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; border: 1px solid var(--hm-line); padding: 4px; background: #fff; flex-shrink: 0; }
.hm-logo-text { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--hm-forest); background: #eef5e8; }
.hm-card-name { min-width: 0; flex: 1; }
.hm-card-name b { display: block; font-size: 17px; }
.hm-card-name small { display: block; color: var(--hm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-skor { background: #fff7e0; color: #a26b00; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.hm-card-price { margin-top: 14px; font-variant-numeric: tabular-nums; }
.hm-card-price .px { font-size: 22px; font-weight: 700; margin-right: 6px; }
.hm-card-price span:not(.px) { font-weight: 600; font-size: 14px; }

.hm-spark { width: 100%; height: 44px; display: block; margin: 8px 0 10px; overflow: visible; }
.hm-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hm-spark.up polyline { stroke: var(--hm-up); }
.hm-spark.dn polyline { stroke: var(--hm-down); }

.hm-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; padding-top: 10px; border-top: 1px dashed var(--hm-line); }
.hm-card-stats dt { font-size: 11px; color: var(--hm-muted); font-weight: 400; }
.hm-card-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-badge { margin-top: auto; align-self: flex-start; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 3px 8px; }
.hm-badge.good { background: #eaf6e0; color: var(--hm-green-dark); }
.hm-badge.warn { background: #fdf0e6; color: #b45a12; }

/* ---------- D. Ringkasan pasar ---------- */
.hm-list { background: #fff; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); padding: 16px 18px; height: 100%; }
.hm-list h3 { font-size: 15px; font-weight: 700; color: var(--hm-ink); margin-bottom: 10px; }
.hm-list ol { list-style: none; margin: 0; padding: 0; }
.hm-list li a {
	display: grid; grid-template-columns: 52px 1fr auto 72px; gap: 8px; align-items: center;
	padding: 8px 0; border-bottom: 1px solid #f1f3f5; color: var(--hm-ink); text-decoration: none; font-size: 14px;
}
.hm-list li:last-child a { border-bottom: 0; }
.hm-list li a:hover .kd { color: var(--hm-green-dark); }
.hm-list .kd { font-weight: 700; }
.hm-list .nm { color: var(--hm-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-list .px, .hm-list .val { text-align: right; font-variant-numeric: tabular-nums; }
.hm-list .val { font-weight: 600; }
.hm-note, .hm-empty { font-size: 12px; color: var(--hm-muted); margin: 10px 0 0; }

/* ---------- E. Promo AI & Terminal ---------- */
.hm-promo { position: relative; height: 100%; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; }
.hm-promo h2 { font-size: 24px; font-weight: 700; margin: 8px 0; }
.hm-promo p { margin-bottom: 18px; }
.hm-promo .btn { margin-top: auto; border-radius: 10px; padding: 10px 20px; font-weight: 600; }
.hm-new { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border-radius: 6px; padding: 2px 8px; }

.hm-promo-ai { background: #eef6e8; color: var(--hm-ink); }
.hm-promo-ai .hm-new { background: var(--hm-green); color: #fff; }
.hm-promo-ai p { color: #4b5a50; }
.hm-chat { width: 100%; margin-bottom: 20px; font-size: 13px; }
.hm-chat .q { margin-left: auto; width: fit-content; max-width: 85%; background: var(--hm-forest); color: #fff; border-radius: 14px 14px 4px 14px; padding: 8px 12px; margin-bottom: 8px; }
.hm-chat .a { width: fit-content; max-width: 100%; background: #fff; border: 1px solid var(--hm-line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.hm-chat table { font-variant-numeric: tabular-nums; }
.hm-chat th, .hm-chat td { padding: 2px 12px 2px 0; text-align: right; }
.hm-chat th:first-child, .hm-chat td:first-child { text-align: left; color: var(--hm-muted); }

.hm-promo-term { background: #161616; color: #c6c6c6; }
.hm-promo-term h2 { color: #f4f4f4; }
.hm-promo-term .hm-new { background: #f1c21b; color: #161616; }
.hm-term { width: 100%; background: #000; border: 1px solid #393939; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 13px; margin-bottom: 20px; }
.hm-term-bar { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid #393939; color: #f1c21b; }
.hm-term-bar span:last-child { background: #f1c21b; color: #000; padding: 0 6px; font-size: 11px; }
.hm-term-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 4px 10px; border-bottom: 1px solid #262626; font-variant-numeric: tabular-nums; }
.hm-term-row span:nth-child(n+2) { text-align: right; }
.hm-term .up { color: #42be65; }
.hm-term .dn { color: #fa4d56; }
.hm-btn-dark { background: #f1c21b; color: #161616; }
.hm-btn-dark:hover { background: #ffd53d; color: #161616; }

/* ---------- Screener ---------- */
.hm-screener {
	display: flex; align-items: center; gap: 16px; height: 100%; background: #fff; border: 1px solid var(--hm-line); border-radius: var(--hm-radius);
	padding: 16px 18px; color: var(--hm-ink); text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.hm-screener:hover { color: var(--hm-ink); text-decoration: none; border-color: var(--hm-green); box-shadow: 0 6px 18px rgba(31,58,42,.08); }
.hm-screener-icon { font-size: 34px; width: 48px; text-align: center; flex-shrink: 0; }
.hm-screener b { display: block; margin-bottom: 2px; }
.hm-screener small { display: block; color: var(--hm-muted); line-height: 1.45; }
.hm-go { margin-left: auto; color: #c0c5cb; transition: transform .2s, color .2s; }
.hm-screener:hover .hm-go { color: var(--hm-green); transform: translateX(3px); }

/* ---------- F. Sektor (heatmap) ---------- */
.hm-sector {
	display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; height: 100%;
	border: 1px solid var(--hm-line); border-radius: var(--hm-radius); padding: 14px 16px; color: var(--hm-ink); text-decoration: none; background: #fff;
	transition: border-color .2s, transform .2s;
}
.hm-sector:hover { color: var(--hm-ink); text-decoration: none; border-color: var(--hm-forest); transform: translateY(-2px); }
.hm-sector i { grid-row: span 2; font-size: 22px; color: var(--hm-forest); align-self: center; }
.hm-sector b { font-size: 14px; }
.hm-sector small { color: var(--hm-muted); }
.hm-sector > span { grid-column: 2; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.heat-up-1 { background: #f1faf3; } .heat-up-2 { background: #ddf3e3; } .heat-up-3 { background: #c4ebcf; }
.heat-dn-1 { background: #fdf3f3; } .heat-dn-2 { background: #fbe1e1; } .heat-dn-3 { background: #f7caca; }

/* ---------- G. Trust bar ---------- */
.hm-trust { background: var(--hm-forest); color: #c9d9cd; padding: 36px 0; text-align: center; }
.hm-trust ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; }
.hm-trust li { font-size: 15px; }
.hm-trust b { display: block; color: #fff; font-size: 26px; font-weight: 700; }
.hm-trust p { margin: 0 auto; max-width: 720px; font-size: 13px; color: #9fb7a5; }

/* ---------- Responsif ---------- */
@media (max-width: 991px) {
	.hm-hero { padding: 40px 0 48px; }
	.hm-hero h1 { font-size: 26px; }
	.hm-lead { font-size: 15px; }
	.hm-section { padding: 40px 0 20px; }
	.hm-head { flex-direction: column; align-items: flex-start; }
}
/* HP: kartu saham digeser ke samping, bukan ditumpuk 6 ke bawah */
@media (max-width: 767px) {
	.hm-cards { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
	.hm-cards > div { flex: 0 0 82%; max-width: 82%; scroll-snap-align: start; }
}
@media (max-width: 575px) {
	.hm-hero h1 { font-size: 22px; }
	.hm-promo { padding: 22px; }
	.hm-list li a { grid-template-columns: 48px 1fr auto 64px; font-size: 13px; }
	.hm-trust b { font-size: 22px; }
}
