
/* 1. GLOBAL DESIGN SETTINGS */

:root {
    --primary: #1258C9;
    --primary-hover: #0C47A8;
    --dark: #17283F;
    --muted: #7C899A;
    --gold: #FFD32A;
    --input-bg: #EDF3FA;
    --input-border: #D2DDEB;
    --ease: cubic-bezier(.22, 1, .36, 1);

    /* EDIT THESE TO ADJUST LOGIN CARD */
    --card-width: 375px;
    --card-height: 605px;
    --card-padding-x: 27px;
    --card-padding-y: 28px;
    --card-logo-size: 76px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body.bs-login {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #234E78;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

/* 2. FULL-SCREEN BACKGROUND */

.login-screen {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.scene-background,
.scene-overlay {
    position: absolute;
    inset: 0;
}

.scene-background {
    z-index: 0;
    background: linear-gradient(130deg, #3D6994, #1C426B);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: backgroundZoom 18s ease-in-out infinite alternate;
}

/* Building image */
.scene-background.has-photo {
    background-image: url("img/barangay-hall.jpg");
}

.photo-label {
    position: absolute;
    top: 20%;
    left: 50%;
    width: 80%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.5);
    font-size: 14px;
    text-align: center;
}

.scene-overlay {
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(5,18,36,.72) 0%,
        rgba(5,18,36,.53) 45%,
        rgba(5,18,36,.20) 100%
    );
}

/* 3. TOP BARANGAY BRANDING */

.site-brand {
    position: absolute;
    z-index: 5;
    top: 16px;
    left: clamp(30px, 8vw, 170px);

    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    display: block;
    width: 47px;
    height: 47px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    color: #20528D;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: white;
}

.site-brand-text strong {
    font-size: 11px;
    letter-spacing: 1.3px;
}

.site-brand-text span {
    font-size: 10px;
    opacity: .85;
}

/* 4. MAIN TWO-COLUMN LAYOUT */

.login-layout {
    position: absolute;
    inset: 0;
    z-index: 3;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(320px, var(--card-width));

    align-items: center;
    column-gap: clamp(25px, 4vw, 75px);

    width: 100%;
    height: 100%;

    padding:
        60px
        clamp(35px, 8vw, 170px)
        52px;
}

/* 5. LEFT WELCOME CONTENT */

.welcome-side {
    width: 100%;
    max-width: 460px;
    min-width: 0;
    color: white;
    animation: fadeUp 500ms var(--ease) both;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;

    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.gold-line {
    display: inline-block;
    width: 27px;
    height: 3px;
    background: var(--gold);
    flex-shrink: 0;
}

.welcome-side h1 {
    margin: 0 0 14px;
    font-size: clamp(38px, 3.3vw, 54px);
    line-height: 1.07;
    letter-spacing: -1.3px;
    font-weight: 800;
    color: white;
    text-shadow: 0 3px 12px rgba(0,0,0,.23);
}

.welcome-side h2 {
    margin: 0 0 16px;
    font-size: clamp(18px, 1.65vw, 23px);
    line-height: 1.35;
    font-weight: 500;
    color: white;
}

.welcome-description {
    max-width: 365px;
    margin: 0;
    color: rgba(255,255,255,.95);
    font-size: 12px;
    line-height: 1.7;
}

.community-note {
    margin-top: 22px;
    color: rgba(255,255,255,.9);
    font-size: 11px;
}

.community-note p {
    margin: 10px 0 0;
}

/* 6. RIGHT LOGIN CARD */

.form-side {
    width: 100%;
    min-width: 0;
}

.login-card {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: var(--card-width);

    /* Taller reference appearance */
    min-height: min(
        var(--card-height),
        calc(100dvh - 112px)
    );

    padding:
        var(--card-padding-y)
        var(--card-padding-x)
        25px;

    margin: 0;
    background: #FFFFFF;
    border-radius: 15px;

    box-shadow: 0 18px 50px rgba(0,0,0,.23);
    animation: cardEnter 600ms var(--ease) both;
}

/* 7. LOGIN CARD BRANDING */

.card-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-logo {
    display: block;
    width: var(--card-logo-size);
    height: var(--card-logo-size);
    margin-bottom: 17px;

    object-fit: contain;
    border-radius: 50%;
    background: white;

    box-shadow: 0 5px 20px rgba(0,0,0,.12);
    animation: logoEnter 650ms var(--ease) both;
}

.card-brand h2 {
    margin: 0 0 6px;
    color: #0752B8;
    font-size: 16px;
    font-weight: 800;
}

.card-brand p {
    margin: 0;
    color: #8791A2;
    font-size: 10px;
}

.card-divider {
    width: 100%;
    height: 1px;
    flex-shrink: 0;
    background: #DCE3ED;
    margin: 23px 0 24px;
}

/* 8. WELCOME BACK HEADING */

.login-heading h3 {
    margin: 0 0 7px;
    color: #18283D;
    font-size: 19px;
    font-weight: 800;
}

.login-heading p {
    margin: 0 0 23px;
    color: #7C8798;
    font-size: 12px;
}

/* 9. LOGIN FORM */

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #24324A;
    font-size: 11px;
    font-weight: 700;
}

.input-wrap {
    display: flex;
    align-items: center;

    width: 100%;
    height: 43px;

    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;

    transition:
        border-color 200ms ease-out,
        box-shadow 200ms ease-out,
        background-color 200ms ease-out;
}

.input-wrap:focus-within {
    border-color: #2563EB;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    flex: 0 0 39px;
    color: #697D97;
}

.input-icon svg,
.toggle-password svg {
    width: 17px;
    height: 17px;
}

.input-wrap input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;

    padding: 0 10px 0 0;
    border: none;
    outline: none;
    background: transparent;

    font-family: inherit;
    font-size: 12px;
    color: #24344F;
}

.input-wrap input::placeholder {
    color: #8998AA;
}

/* 10. PASSWORD VISIBILITY */

.toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    background: transparent;
    padding: 10px;
    color: #677D98;
    cursor: pointer;

    transition:
        color 200ms ease-out,
        transform 200ms ease-out;
}

.toggle-password:hover {
    color: #2563EB;
    transform: scale(1.06);
}

.toggle-password:focus-visible,
.login-button:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 3px;
}

/* 11. LOGIN BUTTON */

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    height: 43px;
    margin-top: 19px;

    border: none;
    border-radius: 6px;

    background: var(--primary);
    color: white;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,.10);

    transition:
        background 200ms ease-out,
        transform 200ms ease-out,
        box-shadow 200ms ease-out;
}

.login-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 7px 17px rgba(18,88,201,.22);
}

/* 12. CARD FOOTER */

.authorized-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;

    margin-top: 21px;
    color: #8290A2;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

.card-footer {
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid #DCE3ED;

    color: #9099A8;
    font-size: 9px;
    text-align: center;
}

/* Space before footer when card grows */
.authorized-text + .card-footer {
    margin-top: auto;
}

/* Error Messages */

.login-error {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #F6C1C6;
    border-radius: 5px;
    background: #FFE8EA;
    color: #AA2435;
    font-size: 12px;
    animation: fadeUp 350ms ease-out both;
}

/* 13. BOTTOM WAVES AND COPYRIGHT */

.bottom-waves {
    position: absolute;
    z-index: 2;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 68px;

    pointer-events: none;
    animation: waveMove 16s ease-in-out infinite alternate;
}

.site-footer {
    position: absolute;
    z-index: 5;
    left: 5%;
    bottom: 9px;

    color: white;
    font-size: 9px;
}

/* 14. ANIMATIONS */

@keyframes backgroundZoom {
    from { transform: scale(1); }
    to { transform: scale(1.035); }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes logoEnter {
    from {
        opacity: 0;
        transform: scale(.90);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes waveMove {
    from { transform: translateY(0); }
    to { transform: translateY(3px); }
}

/* 15. LAPTOP WIDTH */

@media (min-width: 901px) and (max-width: 1200px) {

    .login-layout {
        column-gap: 26px;
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .site-brand {
        left: 5vw;
    }
}

/* 16. SHORTER DESKTOP SCREENS
   Compress spacing to fit browser viewport.
   Card remains fully accessible. */

@media (min-width: 901px) and (max-height: 750px) {

    :root {
        --card-padding-y: 18px;
        --card-logo-size: 58px;
    }

    .card-logo {
        margin-bottom: 10px;
    }

    .card-divider {
        margin: 14px 0;
    }

    .login-heading p {
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        margin-bottom: 6px;
    }

    .input-wrap {
        height: 40px;
    }

    .login-button {
        height: 40px;
        margin-top: 12px;
    }

    .authorized-text {
        margin-top: 12px;
    }

    .card-footer {
        padding-top: 10px;
    }

    .bottom-waves {
        height: 60px;
    }
}

/* 17. VERY SHORT DESKTOP SCREENS
   Keep scrolling enabled when necessary. */

@media (min-width: 901px) and (max-height: 649px) {

    body.bs-login {
        height: auto;
        overflow-y: auto;
    }

    .login-screen {
        height: auto;
        min-height: 650px;
    }

    .login-layout {
        position: relative;
        inset: auto;
        min-height: 650px;
        height: auto;
        padding-top: 80px;
        padding-bottom: 90px;
    }
}

/* 18. TABLET AND MOBILE */

@media (max-width: 900px) {

    body.bs-login {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-screen {
        height: auto;
        min-height: 100dvh;
    }

    .login-layout {
        position: relative;
        inset: auto;

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

        width: 100%;
        height: auto;
        min-height: 100dvh;

        gap: 28px;
        padding: 105px 25px 100px;
    }

    .site-brand {
        top: 16px;
        left: 25px;
    }

    .welcome-side {
        max-width: 450px;
        text-align: center;
    }

    .eyebrow {
        justify-content: center;
    }

    .welcome-side h1 {
        font-size: clamp(32px, 5vw, 43px);
    }

    .welcome-description {
        margin: 0 auto;
    }

    .form-side {
        width: 100%;
        max-width: 390px;
    }

    .login-card {
        max-width: none;
        min-height: 0;
        padding: 24px 23px;
    }

    .card-logo {
        width: 65px;
        height: 65px;
        margin-bottom: 12px;
    }

    .card-divider {
        margin: 16px 0;
    }

    .login-heading p {
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .authorized-text {
        margin-top: 15px;
    }

    .card-footer {
        margin-top: 17px;
        padding-top: 12px;
    }
}

/* 19. SMALL MOBILE SCREENS */

@media (max-width: 480px) {

    .login-layout {
        padding: 92px 16px 100px;
        gap: 24px;
    }

    .site-brand {
        left: 17px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .site-brand-text strong {
        font-size: 10px;
    }

    .welcome-side h1 {
        font-size: 34px;
    }

    .welcome-side h2 {
        font-size: 18px;
    }

    .welcome-description {
        font-size: 12px;
    }

    .login-card {
        padding: 22px 20px 17px;
    }

    .bottom-waves {
        height: 58px;
    }
}

/* 20. ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
