/* =====================================================================
 * Halaman autentikasi ChatKami - login, daftar, OTP, lupa/atur ulang
 * sandi. Dipakai bersama lewat application/views/template_login.php.
 *
 * Dipisah dari template itu 22 Agustus 2026: 370 baris ini sebelumnya
 * tercetak ulang pada SETIAP kunjungan ke halaman login, dan membuat
 * view-source-nya nyaris tidak terbaca.
 *
 * Location: ./assets/css/auth.css
 * ===================================================================== */

/* =====================================================================
   Tampilan halaman autentikasi
   Palet merah ChatKami, diambil dari logo. Semua warna memakai CSS
   variable supaya mode gelap cukup menimpa token, bukan menulis ulang
   aturannya.
   ===================================================================== */
:root {
    /* Diambil langsung dari logo ChatKami */
    --auth-brand-1:   #5c0e14;   /* maroon - tulisan "Chat"      */
    --auth-brand-2:   #d61f2c;   /* merah  - balon besar         */
    --auth-brand-3:   #f2622d;   /* oranye - balon kecil         */
    --auth-ink:       #1f0c0e;
    --auth-muted:     #7a6a6c;
    --auth-card:      #ffffff;
    --auth-page:      #faf5f4;
    --auth-border:    #efe3e2;
    --auth-input:     #ffffff;
    --auth-input-bd:  #e0cdcc;
    --auth-shadow:    0 12px 40px rgba(31, 12, 14, .10);
}
[data-bs-theme="dark"] {
    --auth-ink:       #f7e9e9;
    --auth-muted:     #b39a9c;
    --auth-card:      #1c1416;
    --auth-page:      #10090a;
    --auth-border:    #332326;
    --auth-input:     #241a1c;
    --auth-input-bd:  #402c30;
    --auth-shadow:    0 12px 40px rgba(0, 0, 0, .45);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-page);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--auth-ink);
}

.auth-wrap { display: flex; min-height: 100vh; }

/* ------------------------------------------------ panel kiri (branding) */
.auth-brand {
    position: relative;
    flex: 0 0 46%;
    max-width: 46%;
    padding: 48px 56px;
    color: #fff;
    background: linear-gradient(145deg, var(--auth-brand-1) 0%, var(--auth-brand-2) 52%, var(--auth-brand-3) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
/* Motif: kisi titik halus + gelombang sinyal.
   Menggantikan dua lingkaran besar semi-transparan yang dulu ada di
   sini - bentuk itu tidak mengatakan apa pun tentang produknya.
   Gelombangnya mengacu ke sinyal/pesan, sejalan dengan mark dua balon
   percakapan.

   Keduanya lewat pseudo-element supaya tidak menambah markup, dan
   tanpa satu pun permintaan HTTP tambahan: kisi titiknya murni
   gradient, gelombangnya SVG yang ditanam sebagai data URI. */
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

/* kisi titik, menutupi seluruh panel */
.auth-brand::before {
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.13) 1.4px, transparent 1.4px);
    background-size: 22px 22px;
    /* Dipudarkan ke bawah supaya isi panel tetap yang paling terbaca;
       tanpa mask, titik-titiknya bersaing dengan teks di bawah. */
    -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 72%);
            mask-image: linear-gradient(160deg, #000 0%, transparent 72%);
}

/* gelombang sinyal di sudut bawah-kanan */
.auth-brand::after {
    width: 420px;
    height: 420px;
    right: -110px;
    bottom: -130px;
    opacity: .13;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20fill%3D%22none%22%3E%3Cg%20stroke%3D%22%23ffffff%22%20stroke-width%3D%226%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M40%20150a85%2085%200%200%201%20120%200%22%2F%3E%3Cpath%20d%3D%22M70%20150a45%2045%200%200%201%2060%200%22%2F%3E%3Cpath%20d%3D%22M97%20150a5%205%200%200%201%206%200%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") no-repeat center / contain;
}

.auth-brand > * { position: relative; z-index: 1; }

.auth-logo {
    max-width: 240px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-brand-title {
    /* Metronic memberi setiap h1-h6 warna sendiri lewat
       --bs-heading-color, dan aturan itu MENANG atas `color: #fff`
       yang diwarisi dari .auth-brand. Tanpa baris ini judulnya
       tampil biru tua di atas gradasi merah - nyaris tak terbaca.
       Bukan cacat baru: sebelum rebranding warnanya biru di atas
       gradasi biru, sama-sama tidak terbaca. */
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.02em;
    margin: 0 0 14px;
}
.auth-brand-sub {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .88);
    margin: 0 0 34px;
    max-width: 430px;
}

.auth-feature { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.auth-feature-ic {
    flex: 0 0 42px;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
}
.auth-feature-tx b { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 2px; }
.auth-feature-tx span { font-size: .85rem; color: rgba(255, 255, 255, .8); line-height: 1.5; }

.auth-brand-foot { font-size: .8rem; color: rgba(255, 255, 255, .75); }

/* ------------------------------------------------ panel kanan (form) */
.auth-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
}
.auth-mobile-logo { display: none; text-align: center; margin-bottom: 26px; }
.auth-mobile-logo img { max-height: 54px; max-width: 170px; object-fit: contain; }

.auth-title  { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: var(--auth-ink); }
.auth-sub    { font-size: .93rem; color: var(--auth-muted); margin: 0 0 26px; }

/* ------------------------------------------------ kontrol form */
.auth-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--auth-ink);
    margin-bottom: 7px;
}
.auth-field { position: relative; margin-bottom: 17px; }
/* Awalan "+62" pada kolom nomor WhatsApp.
   Kini menjadi bagian .input-group, jadi cukup diberi pembatas kanan
   agar terbaca terpisah dari nomor yang diketik. */
.auth-phone-pre {
    font-size: .93rem;
    font-weight: 600;
    color: var(--auth-ink);
    padding: 0 12px 0 4px !important;
    border-right: 1px solid var(--auth-input-bd) !important;
    margin-right: 4px;
}
.auth-field .input-group .form-control[readonly] {
    color: var(--auth-muted);
    cursor: not-allowed;
}
.auth-field .input-group:has(.form-control[readonly]) { background: var(--auth-page); }
/* ---------------------------------------------- input-group Metronic
   Kolom dibungkus .input-group agar ikon berada di depan input.
   Border dipindah ke pembungkus, anak-anaknya dibuat transparan,
   sehingga ikon + input + tombol tampak menyatu sebagai satu kolom. */
.auth-field .input-group {
    background: var(--auth-input);
    border: 1px solid var(--auth-input-bd);
    border-radius: 11px;
    overflow: hidden;
    flex-wrap: nowrap;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field .input-group .input-group-text {
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    padding: 0 4px 0 14px;
}
.auth-field .input-group .form-control {
    height: 46px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: .95rem;
    color: var(--auth-ink);
    padding: 0 12px;
}
.auth-field .input-group .form-control:focus { background: transparent; box-shadow: none; }
.auth-field .input-group .form-control::placeholder { color: var(--auth-muted); opacity: .75; }

/* Cincin fokus mengikuti warna merek, dipasang di pembungkus */
.auth-field:focus-within .input-group {
    border-color: var(--auth-brand-2);
    box-shadow: 0 0 0 4px rgba(22, 104, 214, .15);
}
.auth-field.is-invalid .input-group { border-color: #f04438; }
.auth-field.is-invalid:focus-within .input-group { box-shadow: 0 0 0 4px rgba(240, 68, 56, .15); }

/* Tombol lihat/sembunyikan password.
   Dibuat sebagai anak flex dari .input-group (bukan absolute), sehingga
   selalu center terhadap TINGGI INPUT saja - posisinya tidak bergeser
   ketika pesan galat muncul di bawah kolom. */
.auth-toggle {
    align-self: stretch;
    width: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transition: color .15s;
}
.auth-toggle:hover { color: var(--auth-ink); }

/* pesan galat per kolom */
.auth-err {
    display: none;
    font-size: .8rem;
    color: #d92d20;
    margin-top: 6px;
}
    .auth-field.is-invalid .auth-phone-pre { border-color: #f04438; }
.auth-field.is-invalid .auth-err { display: block; }

/* ------------------------------------------------ tombol */
.auth-btn {
    width: 100%;
    height: 48px;
    font-size: .97rem;
    font-weight: 600;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    transition: filter .15s, opacity .15s;
}
.auth-btn-primary { background: linear-gradient(135deg, var(--auth-brand-2), var(--auth-brand-3)); color: #fff; }
.auth-btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.auth-btn:disabled { opacity: .62; cursor: not-allowed; }

.auth-btn-google {
    background: var(--auth-input);
    color: var(--auth-ink);
    border: 1px solid var(--auth-input-bd);
    text-decoration: none;
}
.auth-btn-google:hover { background: rgba(127, 137, 152, .08); color: var(--auth-ink); }

/* ------------------------------------------------ lain-lain */
.auth-sep {
    display: flex; align-items: center; gap: 14px;
    margin: 20px 0;
    color: var(--auth-muted);
    font-size: .82rem;
}
.auth-sep::before, .auth-sep::after {
    content: ""; flex: 1; height: 1px; background: var(--auth-border);
}

.auth-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.auth-link { color: var(--auth-brand-1); font-weight: 600; text-decoration: none; font-size: .87rem; }
.auth-link:hover { text-decoration: underline; color: var(--auth-brand-1); }
[data-bs-theme="dark"] .auth-link { color: var(--auth-brand-3); }

.auth-foot { text-align: center; margin-top: 24px; font-size: .89rem; color: var(--auth-muted); }

.auth-check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 20px; font-size: .86rem; color: var(--auth-muted); }
.auth-check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--auth-brand-2); flex: 0 0 auto; }

.auth-alert {
    display: none;
    padding: 12px 15px;
    border-radius: 11px;
    font-size: .87rem;
    margin-bottom: 18px;
    line-height: 1.5;
}
.auth-alert.show    { display: block; }
.auth-alert-error   { background: rgba(240, 68, 56, .10); color: #d92d20; border: 1px solid rgba(240, 68, 56, .22); }
.auth-alert-success { background: rgba(18, 160, 120, .10); color: #08795c; border: 1px solid rgba(18, 160, 120, .22); }
.auth-alert-info    { background: rgba(22, 104, 214, .10); color: #1257b8; border: 1px solid rgba(22, 104, 214, .22); }
[data-bs-theme="dark"] .auth-alert-success { color: #34d3a6; }
[data-bs-theme="dark"] .auth-alert-info    { color: #6fb6f5; }

/* indikator kekuatan password */
.auth-meter { display: flex; gap: 5px; margin-top: 9px; }
.auth-meter i {
    flex: 1; height: 4px; border-radius: 3px;
    background: var(--auth-border);
    transition: background .2s;
}
.auth-meter.s1 i:nth-child(1) { background: #f04438; }
.auth-meter.s2 i:nth-child(-n+2) { background: #f79009; }
.auth-meter.s3 i:nth-child(-n+3) { background: var(--auth-brand-3); }
.auth-meter.s4 i { background: var(--auth-brand-2); }
.auth-meter-tx { font-size: .78rem; color: var(--auth-muted); margin-top: 6px; }

/* captcha */
.auth-captcha { display: flex; gap: 11px; align-items: stretch; }
.auth-captcha img {
    height: 48px; width: 132px;
    border: 1px solid var(--auth-input-bd);
    border-radius: 11px;
    background: #fff;
    object-fit: cover;
}
.auth-captcha .input-group { flex: 1; }
.auth-captcha .auth-captcha-in { text-align: center; letter-spacing: .22em; font-weight: 600; text-transform: uppercase; }
.auth-captcha-re {
    border: 1px solid var(--auth-input-bd);
    background: var(--auth-input);
    color: var(--auth-muted);
    border-radius: 11px;
    width: 48px;
    cursor: pointer;
}
.auth-captcha-re:hover { color: var(--auth-ink); }

/* kotak input OTP */
.otp-boxes { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 6px; }
.otp-boxes input {
    width: 100%; height: 58px;
    text-align: center;
    font-size: 1.4rem; font-weight: 700;
    color: var(--auth-ink);
    background: var(--auth-input);
    border: 1px solid var(--auth-input-bd);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.otp-boxes input:focus {
    border-color: var(--auth-brand-2);
    box-shadow: 0 0 0 4px rgba(22, 104, 214, .15);
}
.otp-boxes input.filled { border-color: var(--auth-brand-2); }

/* ------------------------------------------------ responsif */
@media (max-width: 991.98px) {
    .auth-brand { display: none; }
    .auth-mobile-logo { display: block; }
    .auth-main { padding: 32px 20px; }
}
@media (max-width: 575.98px) {
    .auth-main  { padding: 24px 16px; align-items: flex-start; }
    .auth-title { font-size: 1.42rem; }
    .otp-boxes  { gap: 7px; }
    .otp-boxes input { height: 52px; font-size: 1.2rem; }
}
