/* ============================================================
 * Halaman login Rafshare Chat — gaya RAF NEXORA (putih + biru)
 * Copyright (c) PT RAF MEDIA DIGITAL
 * ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 5px; border-radius: 4px; }
.alert { border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.alert.error { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: color-mix(in srgb, var(--crit) 10%, transparent); }
.alert.warn  { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.alert.ok    { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* ==========================================================
 * HALAMAN LOGIN & OTP — putih + biru (mengikuti logo)
 * Selalu tema terang agar warna brand konsisten.
 * ========================================================== */
body.auth {
    --navy: #0b1f4d;
    --navy-2: #0f3a8f;
    --blue: #1565ff;
    --cyan: #16b9f2;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f2f6fd;
    --border: #d6e0ef;
    --text: #0b1f4d;
    --muted: #5d6c86;
    --accent: #1565ff;
    --ok: #10875a;
    --warn: #a86400;
    --crit: #d1342b;
    color-scheme: light;
    background: #fff;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
}
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---- Panel kiri: logo ---- */
.auth-brand {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 48px 56px;
    background:
        radial-gradient(900px 500px at 0% 100%, rgba(22, 185, 242, .10), transparent 60%),
        radial-gradient(700px 420px at 100% 0%, rgba(21, 101, 255, .08), transparent 60%),
        #fff;
}
.auth-arc { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-arc-1 {
    width: 720px; height: 720px; left: -380px; bottom: -420px;
    border: 46px solid transparent;
    border-top-color: rgba(21, 101, 255, .08); border-right-color: rgba(22, 185, 242, .10);
    transform: rotate(-20deg);
}
.auth-arc-2 {
    width: 520px; height: 520px; right: -300px; top: -300px;
    border: 28px solid transparent;
    border-bottom-color: rgba(11, 31, 77, .06); border-left-color: rgba(21, 101, 255, .08);
}
.auth-brand-inner { position: relative; width: 100%; max-width: 480px; }
.auth-logo { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 0 28px -12px; mix-blend-mode: multiply; /* latar putih logo menyatu dengan panel */ }
.auth-tagline {
    font-size: clamp(22px, 2.2vw, 30px); line-height: 1.25; font-weight: 700;
    letter-spacing: -.01em; color: var(--navy); margin: 0 0 22px;
}
.auth-tagline span {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap;
}
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-points li {
    position: relative; padding-left: 34px; color: var(--muted); font-size: 15px; line-height: 22px;
}
.auth-points li::before {
    content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 7px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}
.auth-points li::after {
    content: ""; position: absolute; left: 8px; top: 5px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---- Panel kanan: form ---- */
.auth-panel {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 40px 28px;
    background:
        radial-gradient(600px 400px at 85% 10%, rgba(22, 185, 242, .35), transparent 60%),
        radial-gradient(500px 500px at 10% 95%, rgba(21, 101, 255, .45), transparent 60%),
        linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 100%);
}
.auth-panel::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 75%);
            mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 75%);
}
.auth-card {
    position: relative; width: 100%; max-width: 420px;
    background: #fff; border-radius: 20px; padding: 36px 32px 28px;
    box-shadow: 0 24px 60px rgba(5, 16, 48, .35), 0 2px 6px rgba(5, 16, 48, .15);
    animation: auth-in .5s ease-out both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }

.auth-head { margin-bottom: 24px; }
.auth-eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--blue); background: rgba(21, 101, 255, .08); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.auth-head h1 { font-size: 24px; line-height: 1.25; color: var(--navy); margin: 0 0 6px; font-weight: 700; letter-spacing: -.01em; }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-head b { color: var(--navy); }

.auth-form .field { margin-bottom: 18px; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: #8a9ab5; pointer-events: none; transition: fill .2s; }
body.auth .auth-form input[type=text],
body.auth .auth-form input[type=email],
body.auth .auth-form input[type=tel],
body.auth .auth-form input[type=password] {
    width: 100%; margin: 0; height: 50px; padding: 0 14px 0 44px;
    font: inherit; font-size: 16px; /* 16px: cegah auto-zoom di iPhone */
    color: var(--navy); background: var(--surface-2);
    border: 1.5px solid transparent; border-radius: 12px;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
body.auth .auth-form input::placeholder { color: #9aa8bf; }
body.auth .auth-form input:hover { border-color: var(--border); }
body.auth .auth-form input:focus {
    outline: none; background: #fff; border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(21, 101, 255, .12);
}
.input-wrap:focus-within .input-icon { fill: var(--blue); }
.input-wrap input[type=password], .input-wrap input.has-toggle { padding-right: 48px; }
.toggle-pass {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: transparent; cursor: pointer;
}
.toggle-pass svg { width: 20px; height: 20px; fill: #8a9ab5; }
.toggle-pass:hover svg, .toggle-pass[aria-pressed=true] svg { fill: var(--blue); }
.toggle-pass:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }

.auth-btn {
    width: 100%; height: 52px; margin-top: 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font: inherit; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
    border: 0; border-radius: 12px;
    background: linear-gradient(135deg, var(--blue) 0%, #0f4fd6 55%, var(--navy-2) 100%);
    box-shadow: 0 10px 24px rgba(21, 101, 255, .35);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.auth-btn svg { width: 18px; height: 18px; fill: currentColor; transition: transform .2s; }
.auth-btn:hover { filter: brightness(1.07); box-shadow: 0 14px 28px rgba(21, 101, 255, .42); }
.auth-btn:hover svg { transform: translateX(3px); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid rgba(21, 101, 255, .35); outline-offset: 2px; }
.auth-btn[disabled] { opacity: .75; cursor: progress; }

.auth-secure {
    display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; padding-top: 18px;
    border-top: 1px solid #e8eef7; color: var(--muted); font-size: 12px; line-height: 1.5;
}
.auth-secure svg { width: 16px; height: 16px; flex: none; fill: var(--blue); margin-top: 1px; }
.auth-copy { position: relative; margin: 24px 0 0; font-size: 12px; color: rgba(255, 255, 255, .7); text-align: center; }

body.auth .alert { border-radius: 10px; margin-bottom: 18px; }
body.auth code { background: var(--surface-2); }

/* OTP */
body.auth .auth-form input.otp-input {
    padding: 0 12px; height: 60px; text-align: center;
    font-size: 26px; font-weight: 700; letter-spacing: .5em; text-indent: .5em;
    font-variant-numeric: tabular-nums;
}
.otp-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.link-btn {
    font: inherit; font-size: 13px; font-weight: 600; color: var(--blue);
    background: none; border: 0; padding: 6px 0; cursor: pointer;
}
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.link-btn:disabled { color: #9aa8bf; cursor: not-allowed; }
.link-btn.muted-link { color: var(--muted); }

/* ---- Tablet ---- */
@media (max-width: 1024px) {
    .auth-brand { padding: 40px 36px; }
    .auth-panel { padding: 40px 28px 24px; }
}

/* ---- HP: bertumpuk (logo atas, form bawah) ---- */
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .auth-brand { padding: 28px 16px 20px; }
    .auth-brand-inner { max-width: 360px; text-align: center; }
    .auth-logo { max-width: 220px; margin: 0 auto 10px; }
    .auth-tagline { font-size: 17px; margin: 0; }
    .auth-points, .auth-arc-2 { display: none; }
    .auth-arc-1 { width: 420px; height: 420px; left: -260px; bottom: -300px; border-width: 30px; }
    .auth-panel {
        justify-content: flex-start;
        padding: 28px 16px calc(20px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
    }
    .auth-card { padding: 28px 20px 22px; border-radius: 18px; }
    .auth-head h1 { font-size: 21px; }
}
@media (max-width: 360px) {
    .auth-card { padding: 24px 16px 20px; }
    body.auth .auth-form input.otp-input { font-size: 22px; letter-spacing: .35em; text-indent: .35em; }
}
/* HP landscape / layar pendek */
@media (max-height: 560px) and (max-width: 960px) {
    .auth-tagline { display: none; }
    .auth-logo { max-width: 160px; margin-bottom: 0; }
}


/* ---- Tambahan Rafshare Chat ---- */
.auth-logo { mix-blend-mode: normal; }
@media (min-width: 861px) { .auth-logo { margin-left: 0; max-width: 380px; } }
.auth-badge-wa {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; padding: 8px 14px; border-radius: 999px;
    background: rgba(21, 101, 255, .07); color: var(--navy); font-size: 13px; font-weight: 600;
}
.auth-badge-wa svg { width: 18px; height: 18px; fill: #25d366; }
@media (max-width: 860px) { .auth-badge-wa { display: none; } }
