:root {
    --webmap-orange: #f0a52b;
    --webmap-blue: #132f4a;
    --webmap-blue-dark: #10283d;
    --login-panel-bg: rgba(19, 47, 74, 0.82);
    --login-panel-border: rgba(255, 255, 255, 0.22);
    --login-text: #ffffff;
    --login-muted: rgba(255, 255, 255, 0.82);
    --login-field-bg: rgba(255, 255, 255, 0.96);
    --login-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --login-radius: 26px;
}

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

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background: var(--webmap-blue);
    color: var(--login-text);
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
}

.background-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--webmap-blue);
}

.background-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.background-container img.active {
    opacity: 1;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(7, 28, 44, 0.06) 0%,
        rgba(7, 28, 44, 0.10) 48%,
        rgba(7, 28, 44, 0.18) 100%
    );
}

.login-page-shell {
    position: relative;
    z-index: 2;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 6vh, 72px) 18px 86px;
}

.box {
    position: relative;
    isolation: isolate;
    width: min(440px, 100%) !important;
    margin: 0;
    padding: clamp(24px, 4vw, 34px);
    overflow: hidden;
    border: 1px solid var(--login-panel-border);
    border-radius: var(--login-radius);
    background: var(--login-panel-bg);
    box-shadow: var(--login-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.box::before {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: -1;
    pointer-events: none;
    background-image: url('/assets/logos/pca_webmap_logo_1200x1200.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 118% auto;
    opacity: 0.10;
}

.box::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(19, 47, 74, 0.20),
        rgba(19, 47, 74, 0.46)
    );
}

.box form {
    position: relative;
    z-index: 1;
}

.login-kicker {
    margin: 0 0 6px;
    color: var(--webmap-orange);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
}

.login-font {
    margin: 0 0 8px;
    color: var(--login-text);
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 900;
    letter-spacing: 0.01em;
}

.login-subtitle {
    max-width: 32rem;
    margin: 0 auto 24px;
    color: var(--login-muted);
    font-size: 0.94rem;
    line-height: 1.45;
    text-align: center;
}

.invalid-credentials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 18px;
    padding: 9px 14px;
    border: 1px solid rgba(240, 165, 43, 0.48);
    border-radius: 999px;
    background: rgba(240, 165, 43, 0.14);
    color: #ffd28a;
    font-size: 0.88rem;
    font-weight: 800;
}

.form-group {
    margin-bottom: 18px;
    color: var(--login-text);
}

.form-group label {
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
    font-weight: 800;
}

.input-group {
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.input-group-text {
    min-width: 46px;
    justify-content: center;
    border: 1px solid transparent;
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--webmap-blue);
}

.input-group .form-control {
    min-height: 48px;
    border: 1px solid transparent;
    border-left: 0;
    background: var(--login-field-bg);
    color: #10253f;
    font-weight: 650;
}

.input-group .form-control:focus {
    border-color: rgba(240, 165, 43, 0.72);
    box-shadow: 0 0 0 0.18rem rgba(240, 165, 43, 0.20);
}

.input-group .form-control::placeholder {
    color: rgba(16, 37, 63, 0.52);
    font-weight: 500;
}

.password-toggle {
    min-width: 48px;
    border: 1px solid transparent;
    border-left: 1px solid rgba(16, 37, 63, 0.12);
    border-radius: 0 16px 16px 0;
    background: rgba(255, 255, 255, 0.88);
    color: var(--webmap-blue);
}

.password-toggle:hover,
.password-toggle:focus {
    background: #ffffff;
    color: var(--webmap-blue-dark);
}

.login-actions {
    min-height: 58px;
    margin-top: 26px;
    text-align: center;
}

.btn-custom {
    width: min(230px, 100%);
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--webmap-orange);
    color: #10253f;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.btn-custom:hover,
.btn-custom:focus {
    width: min(230px, 100%);
    background: #ffd28a;
    color: #10253f;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.spinner {
    display: none;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(240, 165, 43, 0.28);
    border-radius: 50%;
    border-top-color: var(--webmap-orange);
    animation: spin 1s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-disabled {
    display: none;
}

body > footer,
body > .footer,
body > #footer {
    position: relative;
    z-index: 3;
}

@media (max-width: 768px) {
    .login-page-shell {
        min-height: calc(100vh - 58px);
        align-items: flex-start;
        padding-top: 34px;
        padding-bottom: 76px;
    }

    .box {
        border-radius: 22px;
    }

    .box::before {
        inset: 10px;
        background-size: 126% auto;
    }
}

@media (max-width: 420px) {
    .login-page-shell {
        padding-inline: 12px;
    }

    .box {
        padding: 22px 18px;
        border-radius: 20px;
    }
}
