/* ==========================================================================
   PRO4A COMMAND - Centralized Operations Monitoring and Management Dashboard
   Police Regional Office 4A (CALABARZON)
   ========================================================================== */

/* -------------------- CSS Variables (PNP Theme) -------------------- */
:root {
    --pnp-navy: #0a2540;
    --pnp-navy-dark: #061629;
    --pnp-navy-light: #14365e;
    --pnp-gold: #d4af37;
    --pnp-gold-light: #e8c768;
    --pnp-red: #c8102e;
    --pnp-white: #ffffff;
    --pnp-gray: #e6e9ef;
    --pnp-text-muted: #b8c2d1;
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition: 0.25s ease-in-out;
}

/* -------------------- Base Reset -------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.login-page {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    color: var(--pnp-white);
    background: var(--pnp-navy-dark);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* -------------------- Background Layers -------------------- */
.bg-image {
    position: fixed;
    inset: 0;
    background: url('../../designs/background.png') center 51% / cover no-repeat;
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(6, 22, 41, 0.76) 0%,
        rgba(10, 37, 64, 0.68) 50%,
        rgba(20, 54, 94, 0.72) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.bg-watermark {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(280px, 32vw, 480px);
    aspect-ratio: 1 / 1;
    background: url('../../designs/PNP.png') center center / contain no-repeat;
    opacity: 0.28;
    z-index: 2;
    pointer-events: none;
    filter: brightness(1.55) saturate(1.08) drop-shadow(0 0 44px rgba(212, 175, 55, 0.32));
    animation: watermarkPulse 6s ease-in-out infinite;
}

@keyframes watermarkPulse {
    0%, 100% {
        opacity: 0.22;
        filter: brightness(1.48) saturate(1.06) drop-shadow(0 0 34px rgba(212, 175, 55, 0.26));
    }
    50% {
        opacity: 0.3;
        filter: brightness(1.65) saturate(1.1) drop-shadow(0 0 52px rgba(212, 175, 55, 0.4));
    }
}

/* -------------------- Main Layout -------------------- */
.login-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

.login-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 1rem;
}

.login-row > .brand-side {
    flex: 0 1 540px;
    min-width: 0;
}

.login-row > .login-card-col {
    flex: 0 1 460px;
    min-width: 0;
}

/* -------------------- Login Card (RIGHT) -------------------- */
/* Dark glassmorphism — tugma sa navy + gold theme */
.login-card {
    position: relative;
    background:
        linear-gradient(
            145deg,
            rgba(20, 54, 94, 0.72) 0%,
            rgba(10, 37, 64, 0.78) 100%
        );
    color: var(--pnp-white);
    border-radius: 18px;
    padding: 2.5rem 2.25rem;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(212, 175, 55, 0.18) inset,
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid var(--pnp-gold);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Subtle gold sheen sa kanang-itaas ng card */
.login-card::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-card .logo-wrap {
    text-align: center;
    margin-bottom: 1.4rem;
}

.login-card .logo-wrap img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.login-card h2 {
    font-size: 1.45rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.4rem 0;
    color: var(--pnp-white);
    letter-spacing: 0.5px;
}

.login-card .card-sub {
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.88rem;
    margin-bottom: 1.75rem;
}

/* Form fields */
.login-card .form-group {
    margin-bottom: 1.1rem;
}

.login-card label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pnp-gold-light);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.login-card .input-icon {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.login-card .input-icon .input-leading-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    z-index: 2;
}

.login-card input.form-control {
    display: block;
    width: 100%;
    padding: 0.8rem 0.9rem 0.8rem 2.55rem;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--pnp-white);
    background: rgba(0, 0, 0, 0.28);
    transition: var(--transition);
    caret-color: var(--pnp-gold);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Mas malaki yung right-padding para sa password field (may eye toggle) */
.login-card .input-icon.password-field input.form-control {
    padding-right: 3rem;
}

.login-card input.form-control:focus {
    outline: none;
    border-color: var(--pnp-gold);
    background: rgba(0, 0, 0, 0.4);
    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

.login-card .input-icon:focus-within .input-leading-icon {
    color: var(--pnp-gold);
}

.login-card input.form-control::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

/* Override Chrome/Edge autofill na nagiging puti */
.login-card input.form-control:-webkit-autofill,
.login-card input.form-control:-webkit-autofill:hover,
.login-card input.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--pnp-white);
    -webkit-box-shadow: 0 0 0 1000px rgba(10, 37, 64, 0.95) inset;
    caret-color: var(--pnp-gold);
    transition: background-color 9999s ease-in-out 0s;
}

/* Toggle password visibility — fixed-size square, naka-overlay sa loob ng input */
.login-card .toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--transition);
    z-index: 3;
    line-height: 1;
}

.login-card .toggle-pass:hover {
    color: var(--pnp-gold);
    background: rgba(212, 175, 55, 0.12);
}

.login-card .toggle-pass:focus-visible {
    outline: 2px solid var(--pnp-gold);
    outline-offset: 1px;
}

.login-card .input-icon:focus-within .toggle-pass {
    color: var(--pnp-gold);
}

/* Login button — gold para pumop sa dark card */
.btn-login {
    width: 100%;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--pnp-gold) 0%, var(--pnp-gold-light) 100%);
    color: var(--pnp-navy-dark);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 0.6rem;
    transition: var(--transition);
    box-shadow:
        0 6px 18px rgba(212, 175, 55, 0.32),
        0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--pnp-gold-light) 0%, #f3d57a 100%);
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(212, 175, 55, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    margin-right: 6px;
}

/* Forgot password / helper row */
.helper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.95rem 0 0.35rem;
    font-size: 0.82rem;
}

.helper-row .form-check {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.helper-row .form-check-input {
    margin: 0;
    background-color: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.helper-row .form-check-input:checked {
    background-color: var(--pnp-gold);
    border-color: var(--pnp-gold);
}

.helper-row .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    border-color: var(--pnp-gold);
}

.helper-row a {
    color: var(--pnp-gold-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.helper-row a:hover {
    color: var(--pnp-gold);
    text-decoration: underline;
}

/* Alert message inside card */
.login-alert {
    background: rgba(200, 16, 46, 0.18);
    color: #ffc1ca;
    border: 1px solid rgba(200, 16, 46, 0.35);
    border-left: 4px solid var(--pnp-red);
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-alert.success {
    background: rgba(76, 175, 80, 0.15);
    color: #b8e6ba;
    border-color: rgba(76, 175, 80, 0.35);
    border-left-color: #4caf50;
}

/* -------------------- Brand Side (LEFT) -------------------- */
.brand-side {
    color: var(--pnp-white);
    padding: 1rem;
    text-align: left;
}

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pnp-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 30px;
    background: rgba(212, 175, 55, 0.08);
}

.brand-eyebrow .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pnp-gold);
    box-shadow: 0 0 8px var(--pnp-gold);
}

.brand-title {
    font-size: clamp(2.5rem, 5.5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 0.5rem 0;
    letter-spacing: -1px;
    color: var(--pnp-white);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-title .accent {
    color: var(--pnp-gold);
}

.brand-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 500;
    color: var(--pnp-white);
    margin: 0 0 1.25rem 0;
    line-height: 1.4;
    opacity: 0.92;
}

.brand-tagline {
    display: inline-block;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    font-style: italic;
    color: var(--pnp-gold-light);
    border-left: 3px solid var(--pnp-gold);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    max-width: 540px;
}

.brand-divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--pnp-gold), transparent);
    margin: 1.25rem 0;
    border-radius: 2px;
}

.brand-mission {
    font-size: 0.95rem;
    color: var(--pnp-text-muted);
    line-height: 1.65;
    max-width: 560px;
    margin-bottom: 1.5rem;
}

.brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.brand-features .feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--pnp-white);
    padding: 0.4rem 0.85rem;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 500;
    backdrop-filter: blur(6px);
}

.brand-features .feature-pill i {
    color: var(--pnp-gold);
}

/* -------------------- Footer -------------------- */
.login-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1.25rem 1rem;
    background: rgba(6, 22, 41, 0.7);
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(8px);
}

.login-footer .agency {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pnp-white);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

.login-footer .region {
    font-size: 0.82rem;
    color: var(--pnp-gold);
    letter-spacing: 2px;
    margin: 4px 0 0 0;
    text-transform: uppercase;
    font-weight: 500;
}

.login-footer .copyright {
    font-size: 0.72rem;
    color: var(--pnp-text-muted);
    margin: 6px 0 0 0;
    opacity: 0.7;
}

/* -------------------- Responsive Breakpoints -------------------- */

/* Tablet & below: stack columns - login card MUNA para sa mobile UX */
@media (max-width: 991.98px) {
    .login-row {
        flex-direction: column;
        gap: 2.25rem;
        padding: 0;
    }

    .login-row > .login-card-col,
    .login-row > .brand-side {
        flex: 1 1 auto;
        width: 100%;
        max-width: 560px;
    }

    .login-card-col {
        order: 1;
    }

    .brand-side {
        order: 2;
        text-align: center;
        padding: 0.5rem 0.5rem 1rem;
    }

    .brand-tagline {
        text-align: center;
        border-left: none;
        border-top: 2px solid var(--pnp-gold);
        padding-left: 0;
        padding-top: 0.65rem;
        max-width: 540px;
        margin-left: auto;
        margin-right: auto;
    }

    .brand-divider {
        margin-left: auto;
        margin-right: auto;
        background: linear-gradient(90deg, transparent, var(--pnp-gold), transparent);
    }

    .brand-features {
        justify-content: center;
    }

    .brand-mission {
        margin-left: auto;
        margin-right: auto;
    }

    .bg-watermark {
        opacity: 0.05;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .login-content {
        padding: 1rem 0.75rem;
    }

    .login-card {
        padding: 1.75rem 1.5rem;
    }

    .login-card .logo-wrap img {
        width: 90px;
        height: 90px;
    }

    .login-card h2 {
        font-size: 1.25rem;
    }

    .brand-eyebrow {
        font-size: 0.68rem;
        letter-spacing: 2px;
        padding: 0.3rem 0.7rem;
    }

    .brand-features .feature-pill {
        font-size: 0.7rem;
        padding: 0.3rem 0.7rem;
    }

    .login-footer .agency {
        font-size: 0.85rem;
        letter-spacing: 1px;
    }

    .login-footer .region {
        font-size: 0.7rem;
    }
}

/* Tall but narrow phones */
@media (max-height: 700px) and (min-width: 992px) {
    .login-content {
        padding: 1.25rem 1rem;
    }

    .login-card {
        padding: 1.75rem 2rem;
    }

    .brand-mission {
        display: none;
    }
}

/* -------------------- Animations -------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

.brand-side {
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.spin {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

.btn-login:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .brand-side,
    .spin,
    .bg-watermark {
        animation: none !important;
    }
    * {
        transition: none !important;
    }
}
