/*
 * JPWTS — Login Page Stylesheet (Redesign)
 * ─────────────────────────────────────────────────────────────────────────
 * Design principles:
 *   - Inter font for clean modern feel
 *   - Off-white background (#F7F8FC) — softer than pure white
 *   - No Bootstrap utility classes — all layout is custom
 *   - Soft shadows, no hard borders
 *   - Brand panel: subtle, not dominant
 *   - Form: clear focal point, generous breathing room
 *   - All CSS variables inherited from site.css
 * ─────────────────────────────────────────────────────────────────────────
 */

/* ── Page tokens (login-specific additions to site.css vars) ──────────── */
:root {
    --login-bg:           #F7F8FC;
    --login-panel-bg:     #EEF1F8;
    --login-card-shadow:  0 8px 40px rgba(28, 43, 58, 0.10),
                          0 2px 8px  rgba(28, 43, 58, 0.06);
    --login-input-bg:     #FAFBFD;
    --login-input-border: #DDE1EA;
    --login-input-focus:  #4A7CF7;
    --login-input-radius: 10px;
    --login-btn-bg:       #3A5FA8;
    --login-btn-hover:    #2B4A8B;
    --login-btn-radius:   10px;
    --login-font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Body / Page shell ────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    background-color: var(--login-bg);
    font-family: var(--login-font);
    font-size: 18px;
    color: var(--text-main);
    display: flex;
    align-items: stretch;
}

.login-page {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════════════════
   LEFT BRAND PANEL
   Subtle, not dominant. Uses a very light tinted background, restrained
   typography, and the logo as the centrepiece.
════════════════════════════════════════════════════════════════════════ */
.login-brand-panel {
    flex: 0 0 360px;
    background-color: var(--login-panel-bg);
    border-right: 1px solid #E0E5F0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.brand-panel-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
    max-width: 260px;
}

/* Logo — given space to breathe */
.brand-logo-wrap {
    margin-bottom: 0.25rem;
}

.login-logo {
    width: 72px;
    height: auto;
    object-fit: contain;
}

/* Product name + descriptor */
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.brand-label {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: 0.04em;
    line-height: 1;
}

.brand-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    font-weight: 400;
}

/* Thin divider */
.brand-divider {
    width: 32px;
    height: 2px;
    background-color: var(--brand-border);
    border-radius: 2px;
}

/* Feature bullet list */
.brand-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.brand-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.brand-feature-list li i {
    font-size: 0.85rem;
    color: var(--brand-accent);
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   RIGHT FORM PANEL
════════════════════════════════════════════════════════════════════════ */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: var(--login-bg);
}

/* ── Login card ───────────────────────────────────────────────────────── */
.login-card {
    width: 100%;
    max-width: 400px;
    background-color: #FFFFFF;
    border-radius: 14px;
    padding: 2.5rem 2.25rem;
    box-shadow: var(--login-card-shadow);
}

/* Mobile brand mark — hidden on desktop, shown when panel is hidden */
.login-mobile-brand {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.login-mobile-logo {
    width: 32px;
    height: auto;
}

.login-mobile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: 0.04em;
}

/* ── Card heading ─────────────────────────────────────────────────────── */
.login-card-header {
    margin-bottom: 1.75rem;
}

.login-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.login-subheading {
    font-size: 0.83rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.5;
}

/* ── Error alert ──────────────────────────────────────────────────────── */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 0.82rem;
    line-height: 1.45;
}

.login-alert i {
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ── Field groups ─────────────────────────────────────────────────────── */
.login-field-group {
    margin-bottom: 1.25rem;
}

.login-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

/* Label row: label left, forgot link right */
.login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.login-label-row .login-label {
    margin-bottom: 0;
}

/* ── Input wrapper — positions the icon inside the field ─────────────── */
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field-icon {
    position: absolute;
    left: 0.85rem;
    font-size: 0.88rem;
    color: #9CA8BB;
    pointer-events: none;
    z-index: 1;
}

.login-input {
    width: 100%;
    height: 42px;
    padding: 0 2.5rem 0 2.4rem;
    background-color: var(--login-input-bg);
    border: 1.5px solid var(--login-input-border);
    border-radius: var(--login-input-radius);
    font-family: var(--login-font);
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.16s ease,
                box-shadow   0.16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-input::placeholder {
    color: #B0B9C8;
    font-weight: 400;
}

.login-input:focus {
    border-color: var(--login-input-focus);
    box-shadow: 0 0 0 3px rgba(74, 124, 247, 0.12);
    background-color: #FFFFFF;
}

/* Password field needs right padding for the toggle button */
.login-input-pw {
    padding-right: 2.75rem;
}

/* ── Password visibility toggle ───────────────────────────────────────── */
.login-pw-toggle {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    color: #9CA8BB;
    font-size: 0.9rem;
    border-radius: 5px;
    transition: color 0.15s ease,
                background-color 0.15s ease;
    line-height: 1;
    display: flex;
    align-items: center;
}

.login-pw-toggle:hover {
    color: var(--brand-accent);
    background-color: var(--brand-light);
}

/* ── Validation errors ────────────────────────────────────────────────── */
.login-field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #DC2626;
    font-weight: 400;
}

/* ── Forgot password link ─────────────────────────────────────────────── */
.login-forgot-link {
    font-size: 0.77rem;
    color: var(--brand-accent);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.login-forgot-link:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* ── Sign-in button ───────────────────────────────────────────────────── */
.login-btn {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 1.75rem;
    padding: 0 1rem;
    background-color: var(--login-btn-bg);
    border: none;
    border-radius: var(--login-btn-radius);
    color: #FFFFFF;
    font-family: var(--login-font);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.18s ease,
                box-shadow       0.18s ease,
                transform        0.12s ease;
}

.login-btn:hover {
    background-color: var(--login-btn-hover);
    box-shadow: 0 4px 14px rgba(43, 74, 139, 0.28);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Footer note ──────────────────────────────────────────────────────── */
.login-footer-note {
    margin-top: 1.75rem;
    font-size: 0.72rem;
    color: #B0B9C8;
    text-align: center;
    font-weight: 400;
}


/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════ */

/* Tablet: hide brand panel */
@media (max-width: 860px) {
    .login-brand-panel {
        display: none;
    }

    #frmLogin .login-form-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
    }

    .login-mobile-brand {
        display: flex;
    }
}

/* Mobile */
@media (max-width: 480px) {
    #frmLogin {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        width: 100%;
    }

        #frmLogin .login-page {
            display: flex;
            flex: 1;
            width: 100%;
        }

    .login-form-panel {
        padding: 1.5rem 1.25rem;
    }

    .login-card {
        width: 100%;
        max-width: 92%;
        border-radius: 16px;
        padding: 2rem 1.5rem;
        box-shadow: 0 8px 32px rgba(28, 43, 58, 0.14), 0 2px 8px rgba(28, 43, 58, 0.08);
    }

    .login-heading {
        font-size: 1.3rem;
    }
}
