/* =====================================================================
   assets/css/login.css
   REDESIGN — BYRA Cloud. Tema: MODERN CYBER CLOUD (bersih).
   Revisi:
     1. Grid kotak-kotak DIHAPUS (kesan cyber cukup dari gradient + glow).
     2. Skala dinaikkan supaya pas di layar desktop 100% (tidak kekecilan).
     3. Ikon tombol tema diperbaiki -> selalu SATU ikon bersih:
        matahari (light) / bulan (dark), tidak lagi dobel.
   Semua nama class/selector LAMA dipertahankan agar HTML tetap jalan.
   Font: Manrope (satu keluarga, konsisten).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ===== DESIGN TOKENS ===== */

:root {
    /* -- mode terang -- */
    --bg-top: #f5f8fd;
    --bg-bottom: #e6edfa;

    /* glass kartu & pill */
    --bg-card-clear: rgba(255, 255, 255, 0.58);
    --bg-pill: rgba(255, 255, 255, 0.48);
    --bg-input: rgba(255, 255, 255, 0.74);

    --line: rgba(30, 64, 150, 0.10);
    --line-strong: rgba(30, 64, 150, 0.16);

    --ink: #0d1526;
    --ink-2: #46536e;
    --ink-3: #64748b;
    --ink-4: #94a3b8;

    --accent: #2563eb;
    --accent-2: #0ea5e9;
    --accent-soft: rgba(37, 99, 235, 0.10);
    --accent-hover: #1e40af;
    --btn-fg: #ffffff;

    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --success: #16a34a;

    --card-glow: 0 24px 60px rgba(37, 99, 235, 0.12);
    --btn-glow: 0 12px 26px rgba(37, 99, 235, 0.28);

    --shadow-sm: 0 1px 2px rgba(16, 25, 46, .05), 0 1px 3px rgba(16, 25, 46, .06);
    --shadow-md: 0 4px 16px rgba(16, 25, 46, .07), 0 2px 6px rgba(16, 25, 46, .05);
    --shadow-lg: 0 24px 48px rgba(16, 25, 46, .12), 0 8px 18px rgba(16, 25, 46, .07);

    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 28px;
    --r-pill: 100px;

    --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

    /* ikon input (netral, sama di kedua mode) */
    --icon-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.2'/%3E%3Cpath d='M5 19.5c0-3.6 3.1-6.2 7-6.2s7 2.6 7 6.2'/%3E%3C/svg%3E");
    --icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='9' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
    --icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.2A10.8 10.8 0 0 1 12 5c5 0 9 3.5 10 7-.4 1.2-1 2.3-1.9 3.3M6.2 6.2C4 7.6 2.4 9.6 2 12c1 3.5 5 7 10 7 1.3 0 2.6-.2 3.7-.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
    --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    --icon-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a4.5 4.5 0 0 1-.5-8.97A5.5 5.5 0 0 1 17.5 9.5 4 4 0 0 1 17 18H7Z'/%3E%3Cpath d='M12 11v7M9.5 13.5 12 11l2.5 2.5'/%3E%3C/svg%3E");

    /* -- GLYPH ikon tema (dipakai sebagai MASK, warna ikut teks) --
       Dipakai untuk menggambar SATU ikon bersih di tombol tema,
       menggantikan ikon bawaan HTML supaya tidak tampil dobel. */
    --glyph-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
    --glyph-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.3 6.3 0 0 0 10.5 10.5Z'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
    /* -- mode gelap -- */
    --bg-top: #06080f;
    --bg-bottom: #0a1020;

    --bg-card-clear: rgba(17, 24, 42, 0.55);
    --bg-pill: rgba(17, 24, 42, 0.45);
    --bg-input: rgba(13, 19, 34, 0.62);

    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(120, 170, 255, 0.20);

    --ink: #eef3ff;
    --ink-2: #aeb9d4;
    --ink-3: #8b93ab;
    --ink-4: #5b6580;

    --accent: #3b82f6;
    --accent-2: #22d3ee;
    --accent-soft: rgba(59, 130, 246, 0.18);
    --accent-hover: #60a5fa;
    --btn-fg: #ffffff;

    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --success: #34d399;

    --card-glow: 0 26px 70px rgba(37, 99, 235, 0.24);
    --btn-glow: 0 14px 30px rgba(59, 130, 246, 0.40);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, .55), 0 8px 18px rgba(0, 0, 0, .4);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.005em;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s ease, color .4s ease;
}

/* ===== LATAR: FOTO (Light/Dark) DENGAN CROSSFADE MULUS ===== */
/* Dua layer foto ditumpuk persis di tempat yang sama (fixed, full-viewport).
   Yang aktif ditandai lewat opacity 1 / 0, transition opacity panjang ->
   hasilnya crossfade halus saat ganti tema, bukan potongan mendadak.
   File foto ada di root subdomain (cloud.byraweb.my.id/Ligh_Mode.png
   dan /Dark_Mode.png), makanya path-nya absolut mulai dari "/". */

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    transition: opacity 1.6s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity;
}

/* layer mode terang */
body::before {
    background-image: url('/Ligh_Mode.png');
    opacity: 1;
}

/* layer mode gelap */
body::after {
    background-image: url('/Dark_Mode.png');
    opacity: 0;
}

/* saat data-theme="dark" aktif -> tukar opacity kedua layer -> crossfade */
[data-theme="dark"] body::before {
    opacity: 0;
}

[data-theme="dark"] body::after {
    opacity: 1;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 .5em 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
}

::selection {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ===== LAYOUT ===== */

.public-shell {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

/* ===== TOPBAR — pill glass bersih ===== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 18px 11px 22px;
    margin: 34px 0 48px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-strong);
    background: var(--bg-pill);
    backdrop-filter: url(#liquid-glass) saturate(150%);
    -webkit-backdrop-filter: blur(9px) saturate(140%);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, .35);
}

[data-theme="dark"] .topbar {
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* .icon-btn — tombol bahasa (ID) & toggle tema */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--bg-card-clear);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: background-color .25s ease, border-color .25s ease,
                color .25s ease, transform .25s ease;
}

.icon-btn svg {
    display: block;
}

.icon-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

#btn-theme-toggle:hover {
    transform: rotate(20deg);
}

/* ===== FIX IKON TEMA — SELALU SATU IKON BERSIH =====
   Ikon bawaan HTML (.icon-sun/.icon-moon, apapun bentuknya) disembunyikan,
   lalu tombol menggambar sendiri satu ikon lewat mask (warna ikut teks).
   Light -> matahari, Dark -> bulan. Tidak akan dobel lagi. */
#btn-theme-toggle .icon-sun,
#btn-theme-toggle .icon-moon {
    display: none !important;
}

#btn-theme-toggle::before {
    content: '';
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: var(--glyph-sun) no-repeat center / contain;
    mask: var(--glyph-sun) no-repeat center / contain;
    transition: background-color .25s ease;
}

[data-theme="dark"] #btn-theme-toggle::before {
    -webkit-mask-image: var(--glyph-moon);
    mask-image: var(--glyph-moon);
}

/* ===== AUTH CARD — GLASS BERSIH ===== */

.auth-card {
    position: relative;
    max-width: 440px;
    margin: 5vh auto 0;
    background: var(--bg-card-clear);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    padding: 48px 40px 44px;
    backdrop-filter: url(#liquid-glass) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    box-shadow:
        var(--shadow-lg),
        var(--card-glow),
        inset 0 1px 0 rgba(255, 255, 255, .30);
    overflow: hidden;
}

[data-theme="dark"] .auth-card {
    box-shadow:
        var(--shadow-lg),
        var(--card-glow),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* garis aksen tipis di sisi atas kartu */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    opacity: .7;
}

/* .auth-logo — logo BYRA Cloud, menggantikan posisi judul teks
   "Cloud by byra" (h1 lama dihapus dari HTML). */
.auth-logo {
    display: block;
    height: 119px;
    width: auto;
    margin: 0 auto 30px;
}

/* fallback kalau file logo gagal dimuat (lihat onerror di HTML) */
.auth-logo-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 116px;
    height: 116px;
    margin: 0 auto 30px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--btn-fg);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    box-shadow: 0 10px 24px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, .30);
}

.auth-subtitle {
    text-align: center;
    color: var(--ink-3);
    font-size: 15px;
    margin: 0 0 30px;
}

@media (max-width: 640px) {
    .auth-card {
        margin-top: 3vh;
        padding: 40px 28px 36px;
    }
    .auth-logo,
    .auth-logo-fallback {
        margin-bottom: 22px;
    }
}

/* ===== FORM ===== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 8px;
    letter-spacing: .01em;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-input);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15.5px;
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.form-input::placeholder {
    color: var(--ink-4);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ikon di dalam input */
.form-input.icon-user,
.form-input.icon-lock {
    padding-left: 48px;
    background-repeat: no-repeat;
    background-position: 16px center;
    background-size: 19px 19px;
}

.form-input.icon-user { background-image: var(--icon-user); }
.form-input.icon-lock { background-image: var(--icon-lock); }

/* wrapper khusus field password */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-right: 48px;
}

.input-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: var(--icon-eye) no-repeat center / 19px 19px;
    background-color: transparent;
}

/* "Ingat saya" */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 26px;
    font-size: 14px;
    color: var(--ink-2);
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
}

.form-error::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
}

/* ===== BUTTONS ===== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: var(--btn-fg);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    box-shadow: var(--btn-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1),
                box-shadow .3s cubic-bezier(.22, 1, .36, 1),
                filter .3s ease;
}

.btn-primary::after {
    content: '';
    display: inline-block;
    width: 17px;
    height: 17px;
    background: var(--icon-arrow) no-repeat center / 17px 17px;
    transition: transform .3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-primary:hover::after {
    transform: translateX(3px);
}

/* ===== AKSESIBILITAS ===== */

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    .icon-btn,
    #btn-theme-toggle,
    .btn-primary,
    .form-input {
        animation: none !important;
        transition: none !important;
    }
}