/* Portal Subsidiari Tunas — gaya bersama login & utama */
:root {
    --brand: #0f3b66;        /* biru laut gelap */
    --brand-2: #0a2a4a;
    --brand-3: #1c64b4;      /* biru utama untuk butang */
    --brand-4: #3b8ee6;
    --brand-soft: #e7f0fb;
    --sky: #dcebfc;
    --ground: #f3f6fa;
    --raised: #ffffff;
    --border: #dfe6ef;
    --control: #c9d4e1;
    --text: #15212e;
    --muted: #5b6878;
    --negative: #c0392b;
    --pill-negative-bg: #fdecea; --pill-negative-ink: #8a1f14;
    --pill-positive-bg: #e3f4ea; --pill-positive-ink: #14532d;
    --pill-warning-bg: #fff3d6; --pill-warning-ink: #7a4a05;
    --radius: 14px;
    --radius-sm: 10px;
    --font: Calibri, Carlito, "Segoe UI", Candara, "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--ground);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--brand-4); outline-offset: 2px; }

.ico { width: 20px; height: 20px; flex: none; }

/* tanda jenama */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 18px; line-height: 1.15; }
.brand-name small { display: block; font-weight: 400; font-size: 13px; opacity: .75; }

/* butang */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 22px;
    border: 0; border-radius: var(--radius-sm);
    background: var(--brand-3); color: #fff;
    font-weight: 700; font-size: 16px;
    cursor: pointer; text-decoration: none;
    transition: background .18s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: #1855a0; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .ico { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }

/* masuk berperingkat */
.rise { opacity: 0; transform: translateY(16px); animation: rise .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.no-js .rise { opacity: 1; transform: none; animation: none; }

/* corak titik (dipakai di beberapa tempat) */
.dots {
    background-image: radial-gradient(rgba(255,255,255,.14) 1.5px, transparent 1.6px);
    background-size: 26px 26px;
}

/* ============ LATAR BERCORAK (login) ============ */
.bg {
    position: fixed; inset: 0; z-index: 0;
    background-color: var(--brand);
    overflow: hidden;
}
.bg::before {
    content: "";
    position: absolute; inset: -40px;
    background-image: radial-gradient(rgba(255,255,255,.12) 1.5px, transparent 1.6px);
    background-size: 28px 28px;
    animation: drift 40s linear infinite;
}
@keyframes drift { to { transform: translate(28px, 28px); } }

.bg .float { position: absolute; color: rgba(255,255,255,.06); animation: floaty 18s ease-in-out infinite; }
.bg .f1 { width: 420px; left: -80px; bottom: -60px; }
.bg .f2 { width: 240px; right: 4%; top: 6%; animation-delay: -6s; animation-duration: 22s; color: rgba(59,142,230,.2); }
.bg .f3 { width: 150px; left: 30%; top: -30px; animation-delay: -11s; animation-duration: 16s; }
@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-24px) rotate(6deg); }
}

/* ============ LOGIN ============ */
.login {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 16px;
}

.login-card {
    width: 100%; max-width: 1040px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 12px;
    padding: 12px;
    background: var(--raised);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(3, 18, 36, .4);
}

.login-form { padding: 40px 44px 32px; display: flex; flex-direction: column; justify-content: center; }

.login-head { text-align: center; margin-bottom: 26px; position: relative; padding-top: 6px; }
/* jubin grid samar di belakang ikon */
.login-head .tiles {
    position: absolute; left: 50%; top: -18px; transform: translateX(-50%);
    width: 260px; height: 110px;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
            mask-image: radial-gradient(closest-side, #000 30%, transparent);
    pointer-events: none;
}
.login-head .badge {
    position: relative;
    width: 60px; height: 60px; margin: 0 auto 16px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--brand-3); color: #fff;
    box-shadow: 0 10px 24px rgba(28, 100, 180, .35);
}
.login-head .badge .ico { width: 28px; height: 28px; }
/* logo + teks TunasHR (ganti ikon login) */
.login-head .wordmark {
    position: relative;
    height: 60px; margin: 0 auto 16px;
    display: inline-flex; align-items: center; gap: 12px;
}
.login-head .wordmark .brand-mark { width: 52px; height: 52px; }
.login-head .wm-text { font-size: 34px; font-weight: 700; letter-spacing: -.01em; line-height: 1; color: var(--brand); }
.login-head .wm-text b { font-weight: 700; color: var(--brand-3); }
.login-head h1 { position: relative; font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); }
.login-head p { position: relative; color: var(--muted); margin-top: 6px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.field-wrap { position: relative; }
.field-wrap > .ico { position: absolute; left: 14px; top: 15px; color: var(--muted); pointer-events: none; }
.field input {
    width: 100%; height: 50px;
    padding: 0 48px 0 44px;
    border: 1px solid var(--control);
    border-radius: var(--radius-sm);
    background: var(--raised);
    font-size: 17px;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field select {
    width: 100%; height: 50px;
    padding: 0 44px 0 44px;
    border: 1px solid var(--control);
    border-radius: var(--radius-sm);
    background: var(--raised);
    font-size: 17px;
    color: #8a96a5;
    -webkit-appearance: none; appearance: none;
    cursor: pointer;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.field select option { color: var(--text); }
.select-wrap.chosen select { color: var(--text); font-weight: 700; background: var(--brand-soft); border-color: var(--brand-4); }
.select-wrap.chosen > .ico:first-child { color: var(--brand-3); }
.field select:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 4px var(--brand-soft); }
.field select[aria-invalid="true"] { border-color: var(--negative); }
.field-wrap > .chev { left: auto; right: 14px; }
.field input::placeholder { color: #9aa6b4; }
.field input:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 4px var(--brand-soft); }
.field input[aria-invalid="true"] { border-color: var(--negative); }
.field .err { display: none; color: var(--negative); font-size: 14px; margin-top: 6px; }
.field .err.show { display: block; }

.toggle-pass {
    position: absolute; right: 6px; top: 7px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border: 0; border-radius: 8px;
    background: transparent; color: var(--muted);
    cursor: pointer;
}
.toggle-pass:hover { background: var(--brand-soft); color: var(--brand-3); }

.row-opt { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 18px; font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand-3); }

.login-form .btn { width: 100%; height: 52px; font-size: 17px; }
.login-form .btn.kunci { background: #b9c6d6; box-shadow: none; cursor: not-allowed; transform: none; }

/* persetujuan PDPA (di bawah "Ingat ID") */
.row-opt + .pdpa-row { margin-top: -8px; }
.pdpa-check { align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.pdpa-check input { flex: none; margin-top: 2px; }
.pdpa-check a { color: var(--brand-3); font-weight: 700; text-decoration: none; }
.pdpa-check a:hover { text-decoration: underline; }

/* notis PDPA penuh */
.pdpa-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(10, 42, 74, .55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.pdpa-box {
    width: 100%; max-width: 680px; max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--ground); border-radius: 20px;
    box-shadow: 0 24px 60px rgba(10, 42, 74, .35);
}
.pdpa-head {
    position: relative; display: flex; align-items: center; gap: 16px;
    padding: 22px 56px 22px 26px; color: #fff;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
}
.pdpa-badge {
    width: 50px; height: 50px; flex: none; display: grid; place-items: center;
    border-radius: 14px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
}
.pdpa-badge .ico { width: 26px; height: 26px; }
.pdpa-head h3 { font-size: 20px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.pdpa-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: rgba(255,255,255,.16); padding: 3px 10px; border-radius: 20px; }
.pdpa-tutup {
    position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
    display: grid; place-items: center; border: 0; border-radius: 10px;
    background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.pdpa-tutup:hover { background: rgba(255,255,255,.24); }
.pdpa-tutup .ico { width: 18px; height: 18px; }
.pdpa-body { overflow-y: auto; padding: 20px 24px 8px; }
.pdpa-intro { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.pdpa-item {
    display: flex; gap: 14px; padding: 14px 16px; margin-bottom: 10px;
    background: var(--raised); border: 1px solid var(--border); border-radius: 14px;
}
.pdpa-ikon {
    width: 38px; height: 38px; flex: none; display: grid; place-items: center;
    border-radius: 11px; background: var(--brand-soft); color: var(--brand-3);
}
.pdpa-ikon .ico { width: 20px; height: 20px; }
.pdpa-item h4 { font-size: 16px; font-weight: 700; color: var(--brand); margin: 2px 0 6px; }
.pdpa-item p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.pdpa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pdpa-chips span { font-size: 13px; padding: 3px 10px; border-radius: 20px; background: var(--ground); border: 1px solid var(--border); color: var(--text); }
.pdpa-item.hak { background: var(--pill-warning-bg); border-color: #f3d98f; }
.pdpa-item.hak .pdpa-ikon { background: #fde7a8; color: var(--pill-warning-ink); }
.pdpa-foot {
    display: flex; align-items: center; gap: 16px; padding: 14px 24px;
    background: var(--raised); border-top: 1px solid var(--border);
}
.pdpa-foot p { flex: 1; font-size: 13px; color: var(--muted); }
.pdpa-foot .btn { white-space: nowrap; }
@media (max-width: 600px) {
    .pdpa-overlay { padding: 10px; }
    .pdpa-head { padding: 18px 52px 18px 18px; }
    .pdpa-body { padding: 16px 14px 6px; }
    .pdpa-foot { flex-direction: column; align-items: stretch; padding: 14px; }
}

.secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.secure .ico { width: 18px; height: 18px; color: var(--brand-3); }

.alert { display: none; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--radius-sm); font-size: 15px; }
.alert.show { display: block; }
.alert.bad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.alert.ok  { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }

.login-foot { margin-top: auto; padding-top: 28px; text-align: center; color: var(--muted); font-size: 13px; }

.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* panel ilustrasi */
.login-art {
    position: relative; overflow: hidden;
    border-radius: 18px;
    background-color: var(--sky);
    background-image: radial-gradient(circle at 50% 52%, #ffffff 0, rgba(255,255,255,0) 58%);
    padding: 36px 28px 28px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.login-art h2 { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); }
.login-art h2 span { color: var(--brand-3); }

/* orbit: syarikat mengelilingi logo kumpulan */
.orbit { --r1: 175px; --r2: 118px; position: relative; width: 380px; height: 380px; margin: 24px 0 18px; flex: none; }
.orbit .ring {
    position: absolute; left: 50%; top: 50%;
    border-radius: 50%;
    border: 1px solid rgba(28, 100, 180, .22);
    transform: translate(-50%, -50%);
}
.orbit .ring.a { width: calc(var(--r1) * 2); height: calc(var(--r1) * 2); }
.orbit .ring.b { width: calc(var(--r2) * 2); height: calc(var(--r2) * 2); border-style: dashed; }
.orbit .ring.c { width: 150px; height: 150px; background: rgba(255,255,255,.7); border-color: rgba(28, 100, 180, .12); }

.orbit .core {
    position: absolute; left: 50%; top: 50%;
    width: 92px; height: 92px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--raised);
    box-shadow: 0 12px 30px rgba(28, 100, 180, .25);
}
.orbit .core::after {
    content: ""; position: absolute; inset: -10px; border-radius: 50%;
    border: 2px solid rgba(59, 142, 230, .35);
    animation: pulse 3s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.orbit .core .brand-mark { width: 62px; height: 62px; }

.orbit .whirl { position: absolute; inset: 0; animation: orbit 60s linear infinite; }
.orbit .whirl.rev { animation-duration: 45s; animation-direction: reverse; }
@keyframes orbit { to { transform: rotate(360deg); } }

.orbit .node {
    position: absolute; left: 50%; top: 50%;
    width: 0; height: 0;
    transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}
.orbit .node-in {
    position: absolute; left: 0; top: 0;
    transform: translate(-50%, -50%);
    animation: counter 60s linear infinite;
}
.orbit .whirl.rev .node-in { animation-duration: 45s; animation-direction: reverse; }
@keyframes counter {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

.orbit .co-dot {
    width: 58px; height: 58px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--tone); color: #fff;
    font-weight: 700; font-size: 15px;
    border: 4px solid #fff;
    box-shadow: 0 8px 18px rgba(15, 59, 102, .22);
}
.orbit .feat {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: #fff; color: var(--brand-3);
    box-shadow: 0 6px 14px rgba(15, 59, 102, .15);
}
.orbit .feat .ico { width: 20px; height: 20px; }

.orbit .co-dot {
    padding: 0; cursor: pointer;
    font-family: inherit;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .3s var(--ease);
}
.orbit .co-dot:hover { transform: scale(1.1); }
.orbit.picked .co-dot { opacity: .45; }
.orbit.picked .co-dot.on {
    opacity: 1;
    transform: scale(1.22);
    box-shadow: 0 0 0 6px rgba(59, 142, 230, .28), 0 10px 22px rgba(15, 59, 102, .3);
}

/* label jenama: kad kaca kecil dengan jalur biru di kiri */
.art-brand {
    position: relative; align-self: flex-start;
    padding: 9px 18px 9px 20px; margin-bottom: 26px;
    text-align: left; color: var(--brand);
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 59, 102, .08);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.art-brand::before {
    content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px;
    width: 4px; border-radius: 4px;
    background: linear-gradient(180deg, var(--brand-3), var(--brand));
}
.art-brand .brand-name { font-size: 17px; letter-spacing: .01em; }
.art-brand .brand-name small {
    margin-top: 3px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--brand-3); opacity: 1;
}
.art-caption { margin-top: auto; max-width: 360px; color: var(--muted); font-size: 16px; line-height: 1.45; min-height: 46px; }
.art-caption b { color: var(--brand-3); }

.page-foot { position: relative; margin-top: 20px; text-align: center; color: rgba(255,255,255,.6); font-size: 13px; }
@media (max-width: 900px) {
    .login-card { grid-template-columns: 1fr; max-width: 460px; padding: 10px; }
    .login-art { padding: 22px 16px 18px; }
    .login-art h2 { font-size: 22px; }
    .orbit { --r1: 112px; --r2: 76px; width: 250px; height: 250px; margin: 12px 0 8px; }
    .orbit .ring.c { width: 100px; height: 100px; }
    .orbit .core { width: 66px; height: 66px; }
    .orbit .core .brand-mark { width: 40px; height: 40px; }
    .orbit .co-dot { width: 42px; height: 42px; font-size: 12px; border-width: 3px; }
    .orbit .feat { width: 32px; height: 32px; }
    .orbit .feat .ico { width: 16px; height: 16px; }
    .art-brand { margin-bottom: 14px; }
    .art-caption { font-size: 15px; min-height: 0; }
    .login-form { padding: 24px 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .rise { animation: none; opacity: 1; transform: none; }
    .bg::before, .bg .float, .orbit .whirl, .orbit .node-in, .orbit .core::after { animation: none; }
    * { transition-duration: 0s !important; }
}
