/* ======================================================= */
/* BNB WORKSPACE LOGIN - V13.9 (FINAL LAYOUT FIX)          */
/* ======================================================= */

/* 1. FONT & SETUP DASAR */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
    --primary-color: #1f7288;
    --secondary-color: #288fa5;
    --secondary-color-light: #e8f4f6;
    --secondary-color-dark: #165a6e;
    --text-on-dark: #f0fdf4;
    --text-dark: #1a202c;
    --text-light: #718096;
    --border-light: #dbe5ec;
    --required-red: #e53935;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

/* 2. MENGUNCI VIEWPORT & KANVAS LATAR BELAKANG */
html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}
body {
    background-color: #ffffff;
    position: relative;
}
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 3. AWAN & SHAPE (ELEMEN DEKORATIF) */
.header-shape,
.footer-shape {
    position: absolute;
}
.header-shape {
    width: 380px;
    height: 380px;
    top: -220px;
    left: -120px;
}
.header-shape::before,
.header-shape::after {
    content: "";
    position: absolute;
    background: var(--primary-color);
    animation: morph 12s ease-in-out infinite;
}
.header-shape::before {
    width: 100%;
    height: 100%;
    border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
    transform: rotate(-15deg);
}
.header-shape::after {
    width: 60%;
    height: 60%;
    border-radius: 55% 45% 55% 45% / 45% 55% 45% 55%;
    bottom: 20px;
    right: 0;
    opacity: 0.8;
    transform: rotate(20deg);
    animation-direction: reverse;
}
@keyframes morph {
    0% {
        border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
    }
    50% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    100% {
        border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
    }
}
.footer-shape {
    width: 300px;
    height: 300px;
    background-color: var(--secondary-color);
    bottom: -150px;
    right: -150px;
    border-radius: 100% 0 0 0;
    opacity: 0.8;
}

/* 4. LAYOUT KONTEN UTAMA (MOBILE-FIRST & COMPACT) */
.main-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.75rem;
}
.login-header h1 {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.9;
    color: var(--text-on-dark);
}
.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-on-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.login-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-on-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.login-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; */
    width: 100%;
    padding-bottom: 2rem;
}

/* ===== PERBAIKAN FINAL: Menambah jarak antara logo dan form ===== */
.form-logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 6rem; /* Menjaga posisi vertikal blok tetap di bawah */
    margin-bottom: 4rem; /* INI YANG DIPERBAIKI: dinaikkan dari 2rem untuk memberi ruang napas */
}

.form-logo img {
    width: 100px;
    max-width: 100%;
    height: auto;
}
.login-main form {
    width: 100%;
    max-width: 380px;
}
.login-footer {
    text-align: center;
    margin-top: auto;
}
.branding-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dark);
}
.branding-text span {
    font-weight: 400;
    color: var(--text-light);
}
.copyright-text {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-light);
}

/* 5. INPUT FIELD & TOMBOL (WITH EFFECT)*/
@keyframes shine-effect {
    0% {
        transform: translateX(-200%) skewX(-25deg);
    }
    10% {
        transform: translateX(-200%) skewX(-25deg);
    }
    30% {
        transform: translateX(200%) skewX(-25deg);
    }
    100% {
        transform: translateX(200%) skewX(-25deg);
    }
}

button[type="submit"] {
    position: relative;
    overflow: hidden;
    z-index: 1;
    width: 100%;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(40, 143, 165, 0.4);
}

button[type="submit"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shine-effect 10s infinite;
}

button[type="submit"]:hover {
    background: var(--secondary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(40, 143, 165, 0.4);
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}
.input-field {
    width: 100%;
    border: 0;
    border-bottom: 2px solid var(--border-light);
    outline: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
    padding: 10px 5px;
    background: transparent;
    transition: border-color 0.3s ease;
}
.input-field::placeholder {
    color: transparent;
}
.input-label {
    position: absolute;
    top: 10px;
    left: 5px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: var(--text-light);
    pointer-events: none;
}
.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label {
    top: -16px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}
.input-field:focus {
    border-bottom-color: var(--primary-color);
}

/* TAMBAHAN UNTUK LOGIN STEP 2 */
.input-field[readonly] {
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-bottom-color: var(--border-light) !important;
}
.input-field.has-icon {
    padding-right: 45px;
}
.toggle-password-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.2rem;
    padding: 5px;
    height: 100%;
    display: flex;
    align-items: center;
}
.toggle-password-btn:hover {
    color: var(--primary-color);
}
.form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    padding: 0 5px;
}
.form-links a {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s ease;
}
.form-links a:hover {
    color: var(--primary-color);
}
.login-error {
    color: var(--required-red);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

/* 6. GAYA DESKTOP */
@media (min-width: 1024px) {
    .main-content {
        padding: 3rem 4rem;
    }
    .header-shape {
        transform: scale(1.5);
        top: -250px;
        left: -80px;
    }
    .footer-shape {
        transform: scale(1.3);
        bottom: -180px;
        right: -180px;
    }
    .login-main {
        margin-top: -4rem;
    justify-content: center;
    }
    .login-footer {
        margin-top: 0;
    }
    .login-header h1 {
        font-size: 1.4rem;
    }
    .login-header h2 {
        font-size: 2.5rem;
    }
    .form-logo {
        margin-top: 0;
        margin-bottom: 2rem; /* Jarak untuk desktop tetap ringkas */
    }
    .form-logo img {
        width: 120px;
    }
    .input-field {
        font-size: 1.1rem;
    }
    .input-label {
        font-size: 1.1rem;
    }
    .input-group {
        margin-bottom: 1.5rem;
    }
    button[type="submit"] {
        padding: 15px;
        font-size: 1.1rem;
    }
    .form-links {
        margin-bottom: 1.75rem;
    }
    .form-links a {
        font-size: 0.85rem;
    }
}
