/* ==================================================================
   LOGIN — SiTeMan PDAM
   Responsive: Desktop · Tablet · HP (portrait & landscape)
   ================================================================== */
:root {
    --color-primary:        #0dcaf0;
    --color-primary-hover:  #0078c9;
    --color-background:     linear-gradient(135deg, #cde9ff, #e7f5ff, #cde9ff);
    --color-white:          #ffffff;
    --color-border:         #bcd8ff;
    --color-shadow:         rgba(0, 123, 255, 0.25);
    --input-h:              44px;
    --form-w:               304px;
    --spacing-small:        8px;
    --spacing-medium:       12px;
    --spacing-large:        20px;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--color-background);
    background-size: 300% 300%;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    box-sizing: border-box;
}

/* ==================================================================
   2. CONTAINER
   ================================================================== */
.login-container {
    width: 100%;
    max-width: 380px;
    padding: var(--spacing-large);
    box-sizing: border-box;

    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 0 20px var(--color-shadow);
    text-align: center;
}


/* ==================================================================
   3. LOGO
   ================================================================== */
.logo-container {
    margin-bottom: 10px;
}

.logo-container img {
    width: 90px;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(0, 140, 255, 0.6));
}


/* ==================================================================
   4. JUDUL
   ================================================================== */
.login-title {
    text-align: center;
    margin: 0 0 18px;
    color: #0078c9;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.3;
}

.login-title span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #005fa3;
    margin-top: 4px;
}


/* ==================================================================
   5. FORM
   ================================================================== */
#loginForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}


/* ==================================================================
   6. INPUT — EMAIL & PASSWORD
   ================================================================== */
#loginForm input[type="email"],
#loginForm input[type="password"],
#loginForm input[type="text"] {
    width: 100%;
    max-width: var(--form-w);
    height: var(--input-h);
    padding: 0 15px;
    margin-bottom: 15px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-sizing: border-box;
    background-color: #e8f0fe;
}

#loginForm input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 6px rgba(13, 202, 240, 0.4);
}


/* ==================================================================
   7. PASSWORD WRAPPER + TOGGLE MATA
   ================================================================== */
.password-wrapper {
    position: relative;
    width: 100%;
    max-width: var(--form-w);
    margin-bottom: 15px;
}

.password-wrapper input {
    margin-bottom: 0;                        /* margin di wrapper saja */
    padding-right: 44px;                     /* ruang untuk ikon mata */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);             /* center presisi */
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 6px;                            /* area tap lebih nyaman */
    margin: -6px;                            /* netralkan padding visual */
}


/* ==================================================================
   8. reCAPTCHA CONTAINER
   ================================================================== */
#recaptchaContainer {
    width: 100%;
    max-width: var(--form-w);
    display: flex;
    justify-content: center;
    margin: 12px 0;
    overflow: hidden;                        /* jaga tetap dalam kartu */
}


/* ==================================================================
   9. TOMBOL LOGIN
   ================================================================== */
#loginBtn {
    width: 100%;
    max-width: var(--form-w);
    height: var(--input-h);
    padding: 0 12px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #0dcaf0, #0078c9);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    transition: filter .15s ease, transform .12s ease;
}

#loginBtn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#loginBtn:enabled {
    cursor: pointer;
}

#loginBtn:enabled:hover {
    filter: brightness(1.08);
}

#loginBtn:enabled:active {
    transform: translateY(1px);
}


/* ==================================================================
   10. FORGOT PASSWORD & MESSAGE
   ================================================================== */
.forgot-password {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    color: #0078c9;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}

.message {
    margin-top: 12px;
    font-size: 14px;
    color: #b00020;
    min-height: 18px;
}


/* ==================================================================
   11. ANIMASI BACKGROUND
   ================================================================== */
@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* ==================================================================
   12. RESPONSIVE — TABLET (≤ 768px)
   ================================================================== */
@media (max-width: 768px) {
    body {
        padding: 14px;
    }

    .login-container {
        max-width: 420px;
        padding: 22px 20px;
    }

    .logo-container img {
        width: 84px;
    }

    .login-title {
        font-size: 1.2rem;
    }
    .login-title span {
        font-size: 13px;
    }
}


/* ==================================================================
   13. RESPONSIVE — HP (≤ 480px)
   ================================================================== */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;              /* mulai dari atas */
        padding-top: 20px;
    }

    .login-container {
        max-width: 100%;
        padding: 20px 16px;
        border-radius: 10px;
    }

    .logo-container img {
        width: 72px;
    }

    .login-title {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }
    .login-title span {
        font-size: 12px;
        letter-spacing: .6px;
    }

    #loginForm input[type="email"],
    #loginForm input[type="password"],
    #loginForm input[type="text"] {
        font-size: 14px;
        height: 42px;
        padding: 0 12px;
    }

    #loginBtn {
        height: 42px;
        font-size: 14px;
    }

    .forgot-password {
        font-size: 13px;
    }
    .message {
        font-size: 13px;
    }
}


/* ==================================================================
   14. RESPONSIVE — HP SANGAT KECIL (≤ 360px)
   ================================================================== */
@media (max-width: 360px) {
    .login-container {
        padding: 16px 12px;
    }

    .logo-container img {
        width: 64px;
    }

    .login-title {
        font-size: 1rem;
    }

    /* reCAPTCHA fix 304px → scale 0.9 agar tetap masuk */
    #recaptchaContainer {
        transform: scale(.90);
        transform-origin: center top;
        height: 70px;
    }
}


/* ==================================================================
   15. HP LANDSCAPE (tinggi ≤ 500px)
   ================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 8px;
    }

    .login-container {
        max-width: 480px;
        padding: 12px 18px;
    }

    .logo-container {
        margin-bottom: 4px;
    }
    .logo-container img {
        width: 52px;
    }

    .login-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    .login-title span {
        font-size: 11px;
    }

    #loginForm input[type="email"],
    #loginForm input[type="password"],
    #loginForm input[type="text"] {
        height: 38px;
        font-size: 13px;
        margin-bottom: 10px;
    }

    .password-wrapper {
        margin-bottom: 10px;
    }

    #recaptchaContainer {
        margin: 8px 0;
        transform: scale(.88);
        transform-origin: center top;
        height: 70px;
    }

    #loginBtn {
        height: 38px;
        font-size: 13px;
    }

    .forgot-password,
    .message {
        font-size: 12px;
        margin-top: 8px;
    }
}