/*
 * login.css — redesigned Watchtower login screen.
 *
 * A centered, rounded card floating on a neutral background. A Washington, DC
 * background photo (chosen per-login by season/holiday, see LoginBackgroundBean)
 * fills the card and blends via a left-to-right dark gradient into a form panel on
 * the right that holds the sign-in controls. The panel keeps its own translucent
 * dark backing so the form stays legible over any photo.
 */

:root {
    --wt-login-panel:      #0f1826;   /* right form panel / gradient target */
    --wt-login-panel-2:    #131f31;
    --wt-login-text:       #eaf0f8;
    --wt-login-muted:      #9fb0c6;
    --wt-login-field-bg:   transparent;
    --wt-login-field-bd:   rgba(255, 255, 255, 0.16);
    --wt-login-field-bdf:  rgba(120, 175, 255, 0.85);
}

.wt-login-shell {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    /* Dark (not black) slate surround — a vertical gradient, medium-dark at the top
       fading to the current darker level at the bottom. Still lighter than the near-black
       login panel so the card reads as separate. */
    background: linear-gradient(180deg, #515f74 0%, #37414f 42%, #232c38 100%);
}

.wt-login-card {
    position: relative;
    /* Embrace the background image's aspect (1536x624). Width auto-scales to the
       window — capped at the image's native width, the viewport width, and the width
       that keeps the card within the viewport height — and the height follows the
       aspect ratio, so the whole scene shows uncropped on wide displays. A min-height
       floor keeps the form usable on narrow/short windows (only then does cover crop
       the image top/bottom). */
    width: min(1376px, 95vw, calc(86vh * 1376 / 624));
    aspect-ratio: 1376 / 624;
    min-height: 468px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4);
    background: var(--wt-login-panel);
}

/* Full-bleed background photo; subject sits left/center-left. */
.wt-login-photo {
    position: absolute;
    inset: 0;
    background-position: 28% center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Gradient that blends the photo into the dark form panel on the right. */
.wt-login-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(11, 17, 28, 0.00) 14%,
        rgba(11, 17, 28, 0.22) 34%,
        rgba(11, 17, 28, 0.48) 52%,
        rgba(12, 19, 31, 0.72) 68%,
        rgba(13, 20, 33, 0.90) 84%,
        var(--wt-login-panel) 100%);
}

.wt-login-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(452px, 47%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 40px 42px;
    color: var(--wt-login-text);
    /* Transparent at the left edge so it melts into the scrim, darker toward the
       right for form legibility — a gradual image-to-panel blend. */
    background: linear-gradient(90deg,
        rgba(15, 24, 38, 0.00) 0%,
        rgba(15, 24, 38, 0.30) 34%,
        rgba(15, 24, 38, 0.62) 66%,
        rgba(15, 24, 38, 0.78) 100%);
    overflow-y: auto;
}

/* Validation messages, legible on the dark panel. */
.wt-login-panel .ui-message,
.wt-login-panel .ui-message-error,
.wt-login-panel .ui-message-error-detail,
.wt-login-panel .error { color: #ff8a8a; font-size: 13px; }

/* Brand row */
.wt-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.wt-brand img {
    height: 46px;
    width: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
.wt-brand .wt-brand-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.15;
    text-transform: uppercase;
}
.wt-brand .wt-brand-tag {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--wt-login-muted);
    text-transform: uppercase;
    margin-top: 3px;
}

.wt-signin-h {
    font-size: 26px;
    font-weight: 600;
    margin: 2px 0 6px 0;
}

/* Fields with a leading icon; PrimeFaces inputs styled to match. */
.wt-field { position: relative; display: block; }
.wt-field > i.wt-ficon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wt-login-muted);
    font-size: 15px;
    z-index: 2;
    pointer-events: none;
}
.wt-login-panel .wt-field input.ui-inputfield,
.wt-login-panel .wt-field .ui-password,
.wt-login-panel .wt-field .ui-password input {
    width: 100%;
    box-sizing: border-box;
}
.wt-login-panel .wt-field input.ui-inputfield {
    height: 40px;
    padding: 0 40px 0 40px;
    background: var(--wt-login-field-bg);
    border: 1px solid var(--wt-login-field-bd);
    border-radius: 8px;
    color: var(--wt-login-text);
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wt-login-panel .wt-field input.ui-inputfield::placeholder { color: var(--wt-login-muted); }
.wt-login-panel .wt-field input.ui-inputfield:enabled:focus {
    border-color: var(--wt-login-field-bdf);
    box-shadow: 0 0 0 3px rgba(120, 175, 255, 0.22);
    outline: 0 none;
}
/* PrimeFaces p:password toggle-mask eye icon sits on the right */
.wt-login-panel .wt-field .ui-password { display: block; }
.wt-login-panel .wt-field .ui-password i.ui-icon,
.wt-login-panel .wt-field .ui-password .ui-password-icon {
    right: 14px;
    color: var(--wt-login-muted);
    cursor: pointer;
}

.wt-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--wt-login-text);
    margin: 2px 0;
}

/* Sign-in button — full width; primary color follows the active theme. */
.wt-login-panel .wt-signin-btn.ui-button {
    width: 100%;
    justify-content: center;
    height: 42px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
}
.wt-login-panel .wt-signin-btn.ui-button .ui-button-text { font-size: 16px !important; }

.wt-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--wt-login-muted);
    margin: 12px 0 4px 0;
}
.wt-divider::before,
.wt-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}
.wt-notice {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wt-login-muted);
}

.wt-access {
    font-size: 12px;
    color: var(--wt-login-muted);
    line-height: 1.5;
}
.wt-access strong { color: var(--wt-login-text); }
.wt-access a { color: #7fb4ff; text-decoration: none; }

/* Image credit, bottom-left of the card. */
.wt-credit {
    position: absolute;
    left: 14px;
    bottom: 10px;
    z-index: 3;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.34);
    padding: 3px 9px;
    border-radius: 20px;
    backdrop-filter: blur(2px);
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-login-spinner { margin-top: 10px; color: var(--wt-login-muted); text-align: center; }
.wt-login-error { color: #ff8a8a; }

/* Copyright pinned to the page bottom over the neutral surround. */
.wt-login-copyright {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 6px;
    text-align: center;
    font-size: 10px;
    color: #6b7686;
    pointer-events: none;
}
.wt-login-copyright a { pointer-events: auto; }

/* Responsive: collapse to a single dark panel over the photo on narrow screens. */
@media (max-width: 860px) {
    .wt-login-card { height: min(660px, 92vh); }
    .wt-login-panel {
        width: 100%;
        background: linear-gradient(180deg, rgba(11,17,28,0.72), rgba(11,17,28,0.9));
    }
    .wt-login-scrim {
        background: linear-gradient(180deg, rgba(11,17,28,0.35), rgba(13,20,33,0.85));
    }
    .wt-credit { max-width: 70%; }
}
