:root {
  --hk-primary: #6B2FA0; --hk-primary-rgb: 107, 47, 160; --hk-primary-soft: #F3ECFA;
  --hk-bg: #FFFFFF; --hk-surface: #FFFFFF; --hk-border: #E8E1F0; --hk-text: #1C1528; --hk-muted: #6E6680;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
[data-bs-theme="dark"] {
  --hk-primary: #A774DB; --hk-primary-rgb: 167, 116, 219; --hk-primary-soft: #241834;
  --hk-bg: #110B19; --hk-surface: #1A1225; --hk-border: #2F2340; --hk-text: #EDE7F5; --hk-muted: #A79DB8;
}
html, body { height: 100%; }
body { background: var(--hk-bg); color: var(--hk-text); -webkit-font-smoothing: antialiased; }
.auth { display: grid; grid-template-columns: 7fr 3fr; min-height: 100vh; }
@media (max-width: 1199.98px) { .auth { grid-template-columns: 3fr 2fr; } }

/* ---- Panel kiri (70%) ---- */
.auth-visual { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 4vw, 3.5rem); background-size: cover; background-position: center; isolation: isolate; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background: var(--auth-overlay, #3B1466); opacity: var(--auth-overlay-opacity, .82); z-index: -1; }
.auth-visual::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.14), transparent 45%), radial-gradient(circle at 10% 90%, rgba(255,255,255,.08), transparent 40%); }
.auth-brand { display: inline-flex; align-items: center; gap: .75rem; background: #fff; padding: .55rem .9rem; border-radius: 16px; }
.auth-brand img { height: 40px; }
.auth-copy { max-width: 560px; position: relative; z-index: 2; }
.auth-copy h1 { font-size: clamp(2rem, 3.4vw, 3.25rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; color: #fff; margin-bottom: 1rem; text-wrap: balance; }
.auth-copy p { font-size: 1.1rem; color: rgba(255,255,255,.82); margin: 0; }
.auth-facts { display: flex; flex-wrap: wrap; gap: .75rem; position: relative; z-index: 2; }
.auth-facts span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); padding: .55rem .9rem; border-radius: 999px; font-size: .875rem; font-weight: 600; }

/* Ikon dekoratif melayang */
.float-icon { position: absolute; width: var(--s, 64px); height: var(--s, 64px); border-radius: 22px; display: grid; place-items: center; font-size: calc(var(--s, 64px) * .4); color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); animation: hk-float var(--d, 7s) ease-in-out infinite; animation-delay: var(--delay, 0s); z-index: 1; }
@keyframes hk-float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-18px) rotate(calc(var(--r, 0deg) * -1)); } }

/* ---- Panel kanan (30%) ---- */
.auth-form-wrap { background: var(--hk-surface); display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 2.75rem); border-left: 1px solid var(--hk-border); }
.auth-form-top { display: flex; justify-content: space-between; align-items: center; }
.auth-form-top a { color: var(--hk-muted); font-weight: 600; font-size: .875rem; text-decoration: none; }
.auth-form-top a:hover { color: var(--hk-primary); }
.auth-form { margin: auto 0; width: 100%; max-width: 380px; align-self: center; padding: 2rem 0; }
.auth-form h2 { font-weight: 800; letter-spacing: -.03em; margin-bottom: .35rem; }
.auth-form .lead-muted { color: var(--hk-muted); margin-bottom: 2rem; }
.form-label { font-weight: 600; font-size: .875rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--hk-muted); pointer-events: none; transition: color .2s; }
.input-icon .form-control { padding: .8rem 1rem .8rem 2.75rem; border-radius: 14px; border-color: var(--hk-border); background: var(--hk-surface); color: var(--hk-text); }
.input-icon .form-control:focus { border-color: var(--hk-primary); box-shadow: 0 0 0 .25rem rgba(var(--hk-primary-rgb), .15); }
.input-icon:focus-within > i { color: var(--hk-primary); }
.input-icon .toggle-pass { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--hk-muted); width: 38px; height: 38px; border-radius: 10px; }
.input-icon .toggle-pass:hover { color: var(--hk-primary); background: var(--hk-primary-soft); }
.input-icon .form-control.has-toggle { padding-right: 3rem; }
.caps-warning { font-size: .8rem; color: #B7791F; margin-top: .4rem; }
.form-check-input:checked { background-color: var(--hk-primary); border-color: var(--hk-primary); }
.btn-login { background: var(--hk-primary); border: 0; color: #fff; border-radius: 14px; padding: .85rem; font-weight: 700; width: 100%; position: relative; overflow: hidden; }
.btn-login:hover, .btn-login:focus { background: color-mix(in srgb, var(--hk-primary) 88%, #000); color: #fff; }
[data-bs-theme="dark"] .btn-login, [data-bs-theme="dark"] .btn-login:hover { color: #170B24; }
.btn-login.is-success { background: #12A594; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hk-border); background: transparent; color: var(--hk-text); }
.theme-toggle:hover { border-color: var(--hk-primary); color: var(--hk-primary); }
.theme-toggle .fa-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .fa-sun { display: inline; }
[data-bs-theme="dark"] .theme-toggle .fa-moon { display: none; }
.auth-foot { color: var(--hk-muted); font-size: .8rem; text-align: center; }
.shake { animation: hk-shake .4s; }
@keyframes hk-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 260px; padding-bottom: 4.5rem; }
  .auth-facts, .float-icon.hide-sm { display: none; }
  .auth-form-wrap { border-left: 0; border-radius: 28px 28px 0 0; margin-top: -2rem; position: relative; z-index: 3; }
}
@media (prefers-reduced-motion: reduce) { .float-icon { animation: none; } }
.auth-link { color: var(--hk-primary); font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.cf-turnstile { min-height: 65px; }
