/* Layout login partner — port dari hai-hai (layouts/nobleui_login) */
/* ── Palet (sama dengan halaman /ads di aplikasi user) ────────────────── */
:root {
    --ink: #251b19;
    --muted: #716763;
    --orange: #ff7619;
    --red: #d92718;
    --red-dark: #a91611;
    --gold: #ffcf37;
    --gold-dark: #f2a800;
    --cream: #fff6ed;
    --soft: #fff0df;
    --line: #f0d9ca;
    --white: #fff;
    --radius: 24px;
    --shadow: 0 18px 45px rgba(155, 48, 24, .14);
    --grad: linear-gradient(135deg, var(--orange), var(--red));
    --ok: #167a3f;
    --ok-bg: #e6f6ec;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-head: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* ── Kerangka: mobile dulu (satu kolom) ───────────────────────────────── */
.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}

.auth-brand { display: none; }

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 118, 25, .16), transparent 38%),
        radial-gradient(circle at 5% 90%, rgba(217, 39, 24, .10), transparent 34%),
        var(--cream);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 22px 24px;
    box-shadow: var(--shadow);
}

/* Kepala merek di kartu (hanya mobile/tablet) */
.m-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo-tile {
    flex: 0 0 auto;
    width: 54px; height: 54px;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(155, 48, 24, .12);
}
.logo-tile img { height: 38px; width: auto; display: block; }
.m-brand b { display: block; font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.m-brand small { color: var(--muted); font-size: .78rem; }

.auth-title {
    font-family: var(--font-head);
    font-size: 2rem; font-weight: 700; line-height: 1.15;
    margin: 0 0 6px; letter-spacing: -.01em;
}
.auth-lead { margin: 0 0 22px; color: var(--muted); font-size: .95rem; line-height: 1.55; }

/* ── Notifikasi ───────────────────────────────────────────────────────── */
.note {
    display: flex; gap: 10px; align-items: flex-start;
    border-radius: 14px; padding: 12px 14px; margin-bottom: 18px;
    font-size: .9rem; line-height: 1.45;
}
.note i { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
.note.err { background: #ffe9e3; color: var(--red-dark); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.warn { background: #fff6bf; color: #7a4a00; }

/* ── Form ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; }

.control { position: relative; }
.control .ico {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    font-size: 21px; color: var(--muted); pointer-events: none;
}
.control input {
    width: 100%; height: 52px;
    padding: 0 48px 0 48px;
    font: inherit; font-size: 16px; /* 16px: mencegah zoom otomatis di iOS */
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.control input::placeholder { color: #b3a49d; }
.control input:hover { border-color: #e6c9b8; }
.control input:focus {
    outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 118, 25, .18);
}
.control input.is-invalid { border-color: var(--red); }
.control input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(217, 39, 24, .16); }

.toggle {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border: 0; background: transparent;
    color: var(--muted); font-size: 21px; cursor: pointer; border-radius: 12px;
    display: grid; place-items: center;
}
.toggle:hover { background: var(--soft); color: var(--red); }
.toggle:focus-visible { outline: 3px solid rgba(255, 118, 25, .4); }

.field-error { color: var(--red); font-size: .85rem; margin-top: 6px; }

/* Tombol utama: pil bergradasi oranye-merah (sama dengan .btn-primary di /ads) */
.btn-submit {
    width: 100%; height: 54px; margin-top: 6px;
    border: 0; border-radius: 14px;
    background: var(--grad); color: #fff;
    font: 700 15px/1 var(--font); letter-spacing: .01em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 10px 24px rgba(217, 39, 24, .30);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-submit:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 14px 28px rgba(217, 39, 24, .34); }
.btn-submit:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(217, 39, 24, .30); }
.btn-submit:focus-visible { outline: 3px solid rgba(255, 118, 25, .45); outline-offset: 3px; }
.btn-submit[disabled] { opacity: .85; cursor: wait; transform: none; }
.btn-submit .spin {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn-submit.loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.help { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.help i { font-size: 18px; vertical-align: -3px; margin-right: 4px; color: var(--orange); }
.help a { color: var(--red); font-weight: 700; text-decoration: none; }
.help a:hover { text-decoration: underline; }

.legal { margin-top: 20px; text-align: center; color: #b3a49d; font-size: .75rem; }

/* ── Tablet kecil ke bawah: kartu lebih rapat ─────────────────────────── */
@media (max-width: 480px) {
    .auth-panel { padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); align-items: flex-start; }
    .auth-card { padding: 24px 18px 20px; border-radius: 22px; margin-top: 4px; }
    .auth-title { font-size: 1.75rem; }
}

/* Layar pendek (HP landscape): jangan terpotong */
@media (max-height: 560px) and (orientation: landscape) {
    .auth-panel { align-items: flex-start; }
}

/* ── Desktop: panel logo di kiri (tanpa tulisan) + form di kanan ───────── */
@media (min-width: 992px) {
    .auth { grid-template-columns: minmax(380px, 1fr) minmax(460px, 1fr); }

    /* Panel kiri: panggung animasi (murni CSS, tanpa tulisan) */
    .auth-brand {
        --mx: 0; --my: 0;               /* posisi kursor -1..1 (diisi JS, untuk paralaks halus) */
        position: relative; overflow: hidden; isolation: isolate;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(135deg, #ff7619 0%, #f05a1a 30%, #d92718 62%, #ff8a2b 100%);
        background-size: 300% 300%;
        animation: gradShift 16s ease-in-out infinite;
    }
    .auth-brand .layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; transition: transform .25s ease-out; }
    .auth-brand .l-blobs   { transform: translate3d(calc(var(--mx) * -20px), calc(var(--my) * -20px), 0); }
    .auth-brand .l-bubbles { transform: translate3d(calc(var(--mx) * 16px), calc(var(--my) * 16px), 0); }
    .auth-brand .l-sparks  { transform: translate3d(calc(var(--mx) * 30px), calc(var(--my) * 30px), 0); }

    /* Blob besar yang berubah bentuk & melayang pelan */
    .blob { position: absolute; filter: blur(2px); animation: blobMorph 22s ease-in-out infinite; }
    .blob.b1 { width: 520px; height: 520px; right: -150px; top: -140px; background: rgba(255, 207, 55, .34); }
    .blob.b2 { width: 400px; height: 400px; left: -140px; bottom: -120px; background: rgba(255, 255, 255, .13); animation-duration: 28s; animation-direction: reverse; }
    .blob.b3 { width: 340px; height: 340px; left: 18%; top: 8%; background: rgba(169, 22, 17, .30); animation-duration: 34s; }

    /* Gelembung seperti kelereng game, naik pelan dari bawah */
    .bubbles i {
        position: absolute; bottom: -90px; left: var(--x);
        width: var(--s); height: var(--s); border-radius: 50%;
        background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, .22) 34%, rgba(255, 207, 55, .24) 68%, rgba(255, 255, 255, 0) 100%);
        border: 1px solid rgba(255, 255, 255, .38);
        box-shadow: inset -4px -6px 14px rgba(255, 255, 255, .18);
        opacity: 0;
        animation: bubbleRise var(--t) linear var(--d) infinite;
    }

    /* Kilau emas berkedip */
    .sparks i {
        position: absolute; left: var(--x); top: var(--y);
        width: var(--s, 16px); height: var(--s, 16px);
        background: #ffe27a;
        clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
        filter: drop-shadow(0 0 6px rgba(255, 226, 122, .9));
        opacity: 0;
        animation: twinkle 3.4s ease-in-out var(--d) infinite;
    }

    /* Logo melayang + cincin denyut */
    .logo-wrap {
        position: relative; z-index: 2; display: grid; place-items: center;
        transform: translate3d(calc(var(--mx) * 22px), calc(var(--my) * 22px), 0);
        transition: transform .25s ease-out;
    }
    .logo-hero {
        position: relative; z-index: 2;
        width: 168px; height: 168px; border-radius: 44px;
        background: var(--white);
        display: grid; place-items: center;
        box-shadow: 0 24px 60px rgba(120, 20, 10, .38);
        animation: logoFloat 6.5s ease-in-out infinite;
    }
    .logo-hero img { height: 118px; width: auto; display: block; }
    .ring {
        position: absolute; z-index: 1; width: 168px; height: 168px; border-radius: 50px;
        border: 2px solid rgba(255, 255, 255, .6);
        opacity: 0;
        animation: ringPulse 4.2s ease-out infinite;
    }
    .ring.r2 { animation-delay: 1.4s; }
    .ring.r3 { animation-delay: 2.8s; }

    @keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
    @keyframes blobMorph {
        0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
        33%      { border-radius: 58% 42% 38% 62% / 55% 38% 62% 45%; transform: translate3d(34px, 26px, 0) rotate(60deg) scale(1.06); }
        66%      { border-radius: 38% 62% 55% 45% / 60% 52% 48% 40%; transform: translate3d(-26px, 40px, 0) rotate(130deg) scale(.96); }
    }
    @keyframes bubbleRise {
        0%   { transform: translate3d(0, 0, 0) scale(.75); opacity: 0; }
        10%  { opacity: .95; }
        50%  { transform: translate3d(calc(var(--s) * .35), -55vh, 0) scale(1); }
        90%  { opacity: .85; }
        100% { transform: translate3d(calc(var(--s) * -.25), -118vh, 0) scale(1.08); opacity: 0; }
    }
    @keyframes twinkle {
        0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
        50%      { opacity: 1; transform: scale(1) rotate(45deg); }
    }
    @keyframes logoFloat {
        0%, 100% { transform: translateY(0) rotate(-1.5deg); }
        50%      { transform: translateY(-14px) rotate(1.5deg); }
    }
    @keyframes ringPulse {
        0%   { transform: scale(1);   opacity: .55; }
        80%  { opacity: 0; }
        100% { transform: scale(2.7); opacity: 0; }
    }

    .auth-panel { padding: 48px; }
    .auth-card { max-width: 440px; padding: 8px 0; background: transparent; border: 0; box-shadow: none; }
    .m-brand { display: none; }
    .auth-title { font-size: 2.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .auth-brand, .auth-brand *, .auth-brand *::before, .auth-brand *::after { animation: none !important; }
    .bubbles i, .ring { opacity: 0; }
}

/* Posisi gelembung & kilau (CSP melarang inline style, jadi lewat nth-child) */
.bubbles i:nth-child(1) { --s: 64px; --x: 6%; --t: 17s; --d: -3s; }
.bubbles i:nth-child(2) { --s: 28px; --x: 14%; --t: 12s; --d: -9s; }
.bubbles i:nth-child(3) { --s: 46px; --x: 24%; --t: 15s; --d: -6s; }
.bubbles i:nth-child(4) { --s: 18px; --x: 32%; --t: 11s; --d: -2s; }
.bubbles i:nth-child(5) { --s: 78px; --x: 40%; --t: 21s; --d: -12s; }
.bubbles i:nth-child(6) { --s: 34px; --x: 52%; --t: 13s; --d: -8s; }
.bubbles i:nth-child(7) { --s: 22px; --x: 60%; --t: 10s; --d: -4s; }
.bubbles i:nth-child(8) { --s: 58px; --x: 68%; --t: 18s; --d: -14s; }
.bubbles i:nth-child(9) { --s: 30px; --x: 77%; --t: 12s; --d: -1s; }
.bubbles i:nth-child(10) { --s: 44px; --x: 86%; --t: 16s; --d: -10s; }
.bubbles i:nth-child(11) { --s: 16px; --x: 92%; --t: 10s; --d: -7s; }
.bubbles i:nth-child(12) { --s: 26px; --x: 47%; --t: 14s; --d: -11s; }
.sparks i:nth-child(1) { --x: 12%; --y: 18%; --d: 0s; --s: 18px; }
.sparks i:nth-child(2) { --x: 82%; --y: 14%; --d: 1.1s; --s: 14px; }
.sparks i:nth-child(3) { --x: 70%; --y: 62%; --d: 2.2s; --s: 20px; }
.sparks i:nth-child(4) { --x: 20%; --y: 72%; --d: 0.6s; --s: 12px; }
.sparks i:nth-child(5) { --x: 90%; --y: 40%; --d: 1.8s; --s: 16px; }
.sparks i:nth-child(6) { --x: 38%; --y: 12%; --d: 2.8s; --s: 12px; }

/* Dashboard placeholder */
.auth-card form { margin: 0; }

/* Halaman satu kolom (dashboard) */
@media (min-width: 992px) {
    .auth--single { grid-template-columns: 1fr; }
    .auth--single .m-brand { display: flex; }
    .auth--single .auth-card { background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px 22px 24px; }
}
