/* Halaman masuk. Polanya sama dengan aplikasi TWB lain (Daily, Portal Gudang): kartu dua sisi,
   ilustrasi di kiri, logo TWB dan form di kanan. Aksennya hijau Geo Tech Support. */
:root {
    color-scheme: light;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --bg: #eef1ef;
    --card: #ffffff; --art-bg: #f4f6f5;
    --line: #dfe5e2; --field-line: #c9d2ce;
    --ink: #0d1714; --ink-2: #3f4f49; --ink-3: #5b6b65;
    --accent: #0b7a5a; --accent-hover: #065f46; --accent-ink: #ffffff; --accent-soft: rgba(11,122,90,.16);
    --danger: #be123c; --danger-soft: #fdecef; --danger-line: #f6c7d1;
    --warn: #92400e;
    --r-xl: 22px; --r-md: 10px; --r-sm: 8px;
    --sh: 0 30px 70px -40px rgba(13,23,20,.45), 0 1px 2px rgba(13,23,20,.06);
    --ease: cubic-bezier(.2,.8,.2,1);

    /* Ilustrasi */
    --il-card: #ffffff; --il-line: #e3e8e5; --il-head: #15201c; --il-head-dot: #34d399; --il-head-bar: #3a4a44;
    --il-map: #e6efe9; --il-veg: #bfe1c9; --il-road: #ffffff; --il-ground: #e2e7e4; --il-deco: #e1e6e3;
    --il-bar: #dbe1de; --il-bar-strong: #b9c4bf; --il-sky: #dceef6; --il-hill: #a7d7b4; --il-trunk: #7c5a3a; --il-canopy: #2f9d68;
    --il-shadow: rgba(13,23,20,.10);
    --c-tree: #0d9b72; --c-wifi: #0284c7; --c-cctv: #334155; --c-apar: #ea580c; --c-odp: #7c3aed;
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #070c0e;
    --card: #101a1e; --art-bg: #0c1518;
    --line: #1f2c31; --field-line: #2c3c42;
    --ink: #e8f2ee; --ink-2: #b4c4be; --ink-3: #92a39d;
    --accent: #34d399; --accent-hover: #6ee7b7; --accent-ink: #04211a; --accent-soft: rgba(52,211,153,.20);
    --danger: #fda4af; --danger-soft: rgba(251,113,133,.10); --danger-line: rgba(251,113,133,.30);
    --warn: #fbbf24;
    --sh: 0 40px 90px -40px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.5);

    --il-card: #172429; --il-line: #24353b; --il-head: #0a1214; --il-head-bar: #24343a;
    --il-map: #16302a; --il-veg: #23523f; --il-road: #2b3d43; --il-ground: #0f1b1f; --il-deco: #18252a;
    --il-bar: #2a3a40; --il-bar-strong: #3d5058; --il-sky: #1d3a4a; --il-hill: #2a5a40; --il-trunk: #8a6646; --il-canopy: #34b27a;
    --il-shadow: rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }
body {
    margin: 0; min-height: 100vh; padding: 24px;
    display: grid; place-items: center;
    font-family: var(--font-sans); background: var(--bg); color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.theme-fab {
    position: fixed; top: 18px; right: 18px; z-index: 20;
    width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
    background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
    font-size: 1rem; cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.theme-fab:hover { color: var(--ink); border-color: var(--field-line); }

.auth-shell {
    width: min(1000px, 100%); min-height: 560px;
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh);
}

/* Sisi ilustrasi */
.art-side {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
    padding: 40px 44px; background: var(--art-bg); border-right: 1px solid var(--line);
}
.art { width: 100%; max-width: 420px; height: auto; display: block; }
.art-copy { text-align: center; max-width: 36ch; }
.art-copy h2 { margin: 0 0 8px; font-size: 1.22rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; text-wrap: balance; }
.art-copy p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--ink-3); text-wrap: pretty; }

.il-ground { fill: var(--il-ground); }
.il-deco { fill: var(--il-deco); }
.il-card { fill: var(--il-card); stroke: var(--il-line); stroke-width: 1; }
.il-shadow { filter: drop-shadow(0 10px 14px var(--il-shadow)); }
.il-head { fill: var(--il-head); }
.il-head-dot { fill: var(--il-head-dot); }
.il-head-bar { fill: var(--il-head-bar); }
.il-map { fill: var(--il-map); }
.il-veg { fill: var(--il-veg); }
.il-road { fill: none; stroke: var(--il-road); stroke-width: 7; stroke-linecap: round; }
.il-road-thin { stroke-width: 4; }
.il-fiber { fill: none; stroke: var(--c-odp); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; opacity: .8; }
.il-cone { fill: var(--c-cctv); opacity: .18; }
.il-wifi-ring { fill: var(--c-wifi); fill-opacity: .10; stroke: var(--c-wifi); stroke-opacity: .45; stroke-width: 1.5; }
.il-bar { fill: var(--il-bar); }
.il-bar-strong { fill: var(--il-bar-strong); }
.il-switch-on { fill: var(--accent); }
.il-switch-off { fill: var(--il-bar); }
.il-knob { fill: #fff; }
.il-sky { fill: var(--il-sky); }
.il-hill { fill: var(--il-hill); }
.il-trunk { fill: var(--il-trunk); }
.il-canopy { fill: var(--il-canopy); }
.il-ok { fill: var(--c-tree); }
.il-ok-tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.il-ok-pill { fill: var(--c-tree); opacity: .35; }
.pin { stroke: #fff; stroke-width: 2; }
.pin-tail { stroke: none; }
.pin-glyph { fill: #fff; }
.pin-stroke { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.pin-tree, .dot-tree { fill: var(--c-tree); }
.pin-wifi, .dot-wifi { fill: var(--c-wifi); }
.pin-cctv { fill: var(--c-cctv); }
.pin-apar, .dot-apar { fill: var(--c-apar); }
.pin-odp { fill: var(--c-odp); }

/* Sisi form */
.form-side {
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 56px 36px;
}
.brand-logo { display: block; align-self: flex-start; width: auto; height: 44px; margin-bottom: 28px; }
/* Logo aslinya hitam dengan latar tembus pandang: di tema gelap dijadikan putih */
[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); }
.form-side h1 { margin: 0 0 6px; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.form-side .sub { margin: 0 0 24px; font-size: .92rem; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.field input {
    width: 100%; height: 46px; padding: 0 14px;
    font-family: var(--font-sans); font-size: .95rem; font-weight: 500; color: var(--ink);
    caret-color: var(--accent);
    background: var(--card); border: 1px solid var(--field-line); border-radius: var(--r-md);
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input:hover { border-color: var(--ink-3); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 52px; }
.toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center;
    background: none; border: 0; color: var(--ink-3); font-size: 1.05rem; cursor: pointer;
}
.toggle:hover { color: var(--ink); }
.caps { display: none; align-items: center; gap: 6px; margin-top: 7px; font-size: .8rem; font-weight: 600; color: var(--warn); }
.caps.on { display: flex; }

.btn-submit {
    width: 100%; height: 48px; margin-top: 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: var(--font-sans); font-size: .95rem; font-weight: 700;
    color: var(--accent-ink); background: var(--accent);
    border: 0; border-radius: var(--r-md); cursor: pointer;
    transition: background .16s var(--ease), transform .1s var(--ease);
}
.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { cursor: progress; opacity: .85; }
.btn-submit .spin { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.btn-submit.loading .spin { display: block; }
.btn-submit.loading .lbl { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.help { margin: 12px 0 0; font-size: .82rem; line-height: 1.5; color: var(--ink-3); text-align: center; }

.err {
    display: flex; align-items: flex-start; gap: 9px;
    margin-bottom: 18px; padding: 11px 13px;
    font-size: .86rem; font-weight: 600; line-height: 1.45;
    color: var(--danger); background: var(--danger-soft);
    border: 1px solid var(--danger-line); border-radius: var(--r-md);
}
.err i { margin-top: 2px; }

.foot {
    display: flex; flex-direction: column; gap: 2px;
    margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line);
    font-size: .8rem; line-height: 1.5; color: var(--ink-3);
}

/* Layar sentuh dan HP: huruf isian 16px supaya Safari iOS tidak memperbesar halaman; tombol mata 44px */
@media (pointer: coarse), (max-width: 640px) {
    .field input { font-size: 16px; height: 48px; }
    .toggle { width: 44px; height: 44px; right: 2px; }
}
@media (max-width: 860px) {
    body { padding: 76px 16px 24px; align-items: start; }
    .auth-shell { grid-template-columns: 1fr; width: min(460px, 100%); min-height: 0; }
    .art-side { display: none; }
    .form-side { padding: 32px 26px 26px; }
    .form-side h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
