/* ==========================================================
   RESET
========================================================== */

* {
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    margin: 0;

    font-family: "Poppins", sans-serif;

    color: #1f2937;

    overflow-x: hidden;
}


/* ==========================================================
   BACKGROUND
========================================================== */

.login-background {
    position: fixed;

    inset: 0;

    background-image:
        url("../img/upacara_ponpes.JPG");

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    z-index: -3;
}


.background-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(5, 30, 20, 0.88),
            rgba(15, 81, 50, 0.68),
            rgba(0, 0, 0, 0.50)
        );
}


/* ==========================================================
   DECORATION
========================================================== */

.background-circle {
    position: absolute;

    border-radius: 50%;

    filter: blur(2px);

    opacity: 0.18;
}


.circle-one {
    width: 400px;
    height: 400px;

    top: -150px;
    left: -100px;

    background: #4ade80;
}


.circle-two {
    width: 500px;
    height: 500px;

    right: -200px;
    bottom: -200px;

    background: #fbbf24;
}


/* ==========================================================
   CONTAINER
========================================================== */

.login-container {
    min-height: 100vh;

    display: flex;

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

    padding: 30px 20px;
}


/* ==========================================================
   LOGIN CARD
========================================================== */

.login-card {
    width: 100%;
    max-width: 450px;

    padding: 38px 40px 28px;

    background:
        rgba(255, 255, 255, 0.94);

    border: 1px solid rgba(255, 255, 255, 0.5);

    border-radius: 24px;

    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.30);

    backdrop-filter: blur(20px);
}


/* ==========================================================
   BRAND
========================================================== */

.brand {
    display: flex;

    align-items: center;

    gap: 15px;

    margin-bottom: 28px;
}


.brand-logo {
    width: 68px;
    height: 68px;

    flex-shrink: 0;

    display: flex;

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

    background: #fff;

    border-radius: 18px;

    box-shadow:
        0 8px 25px rgba(15, 81, 50, 0.18);
}


.brand-logo img {
    width: 52px;
    height: auto;
}


.brand-title h1 {
    margin: 0;

    color: #0f5132;

    font-size: 25px;

    font-weight: 700;

    letter-spacing: 1px;
}


.brand-title p {
    margin: 3px 0 0;

    color: #6b7280;

    font-size: 11px;
}


/* ==========================================================
   HEADING
========================================================== */

.login-heading {
    margin-bottom: 25px;
}


.login-heading h2 {
    margin: 0 0 5px;

    color: #111827;

    font-size: 23px;

    font-weight: 600;
}


.login-heading p {
    margin: 0;

    color: #6b7280;

    font-size: 13px;
}


/* ==========================================================
   ALERT
========================================================== */

.login-alert {
    display: flex;

    align-items: center;

    gap: 9px;

    margin-bottom: 18px;

    padding: 11px 13px;

    color: #991b1b;

    background: #fef2f2;

    border: 1px solid #fecaca;

    border-radius: 10px;

    font-size: 12px;
}


.login-alert i {
    font-size: 15px;
}


/* ==========================================================
   INPUT
========================================================== */

.input-group {
    margin-bottom: 18px;
}


.input-group label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 12px;

    font-weight: 500;
}


.input-wrapper {
    position: relative;
}


.input-wrapper input,
.captcha-input input {
    width: 100%;

    height: 48px;

    padding:
        0 45px
        0 44px;

    color: #111827;

    background: #f8fafc;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    outline: none;

    font-family: inherit;

    font-size: 13px;

    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}


.input-wrapper input:focus,
.captcha-input input:focus {
    background: #fff;

    border-color: #198754;

    box-shadow:
        0 0 0 4px rgba(25, 135, 84, 0.10);
}


.input-wrapper input::placeholder,
.captcha-input input::placeholder {
    color: #9ca3af;
}


.input-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    color: #9ca3af;

    transform: translateY(-50%);

    font-size: 15px;

    z-index: 2;
}


/* ==========================================================
   PASSWORD
========================================================== */

.password-toggle {
    position: absolute;

    top: 50%;
    right: 14px;

    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #9ca3af;

    transform: translateY(-50%);

    cursor: pointer;

    z-index: 3;
}


.password-toggle:hover {
    color: #198754;
}


.password-toggle:focus {
    outline: none;
}


/* ==========================================================
   CAPTCHA
========================================================== */

.captcha-wrapper {
    display: flex;

    align-items: center;

    gap: 10px;
}


.captcha-image {
    width: 42%;
    height: 48px;

    display: flex;

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

    padding: 5px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    overflow: hidden;
}


.captcha-image img {
    display: block;

    max-width: 100%;
    height: 38px;

    object-fit: contain;
}


.captcha-input {
    position: relative;

    flex: 1;
}


/* ==========================================================
   FIELD ERROR
========================================================== */

.field-error {
    margin-top: 6px;

    color: #dc2626;

    font-size: 11px;
}


.field-error i {
    margin-right: 4px;
}


/* ==========================================================
   LOGIN BUTTON
========================================================== */

.login-action {
    display: flex;

    justify-content: flex-end;

    margin-top: 25px;
}


.login-button {
    display: inline-flex;

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

    gap: 10px;

    min-width: 125px;
    height: 45px;

    padding: 0 20px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #198754,
            #0f5132
        );

    border: 0;

    border-radius: 12px;

    box-shadow:
        0 8px 20px rgba(15, 81, 50, 0.25);

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}


.login-button:hover {
    color: #fff;

    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(15, 81, 50, 0.32);
}


.login-button:active {
    transform: translateY(0);
}


.login-button:disabled {
    opacity: 0.7;

    cursor: not-allowed;

    transform: none;
}


/* ==========================================================
   FOOTER
========================================================== */

.login-footer {
    margin-top: 25px;

    padding-top: 18px;

    text-align: center;

    border-top: 1px solid #f0f0f0;

    color: #9ca3af;

    font-size: 10px;
}


.login-footer i {
    margin-right: 4px;

    color: #198754;
}


/* ==========================================================
   LOADING SCREEN
========================================================== */

#loadingScreen {
    position: fixed;

    inset: 0;

    display: none;

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

    background:
        linear-gradient(
            135deg,
            #061b12,
            #0f5132,
            #07140e
        );

    z-index: 999999;
}


.loading-card {
    width: 320px;

    padding: 30px;

    color: #fff;

    text-align: center;
}


.loading-logo {
    width: 100px;
    height: 100px;

    display: flex;

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

    margin: 0 auto 20px;

    background: #fff;

    border-radius: 50%;

    animation: loadingPulse 2s infinite;

    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.2);
}


.loading-logo img {
    width: 68px;
}


.loading-card h2 {
    margin: 0 0 8px;

    font-size: 24px;

    letter-spacing: 3px;
}


.loading-card p {
    margin: 0;

    color: rgba(255, 255, 255, 0.7);

    font-size: 12px;
}


.loading-progress {
    width: 100%;
    height: 7px;

    margin-top: 28px;

    background: rgba(255, 255, 255, 0.15);

    border-radius: 10px;

    overflow: hidden;
}


.loading-progress-value {
    width: 0;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #4ade80,
            #22d3ee
        );

    transition: width 0.15s linear;
}


.loading-percent {
    margin-top: 12px;

    font-size: 24px;

    font-weight: 600;
}


@keyframes loadingPulse {

    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.07);
    }

    100% {
        transform: scale(1);
    }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 480px) {

    .login-container {
        padding: 20px 15px;
    }


    .login-card {
        padding: 28px 22px 22px;

        border-radius: 20px;
    }


    .brand {
        margin-bottom: 23px;
    }


    .brand-logo {
        width: 58px;
        height: 58px;
    }


    .brand-logo img {
        width: 44px;
    }


    .brand-title h1 {
        font-size: 21px;
    }


    .brand-title p {
        font-size: 9px;
    }


    .login-heading h2 {
        font-size: 21px;
    }


    .captcha-wrapper {
        gap: 7px;
    }


    .captcha-image {
        width: 45%;
    }


    .login-button {
        width: 100%;
    }


    .login-action {
        display: block;
    }

}