/* ============================================================
   PayrollSys — Login Page
   Primary: #1a3a5c  Accent: #2563a8  (matches home/theme)
   ============================================================ */

:root {
    --lp-primary:   #1a3a5c;
    --lp-accent:    #2563a8;
    --lp-accent-lt: #3b82f6;
    --lp-white:     #ffffff;
    --lp-bg:        #f0f4f9;
    --lp-border:    #dde4ef;
    --lp-text:      #1e293b;
    --lp-muted:     #64748b;
    --lp-danger:    #dc3545;
    --lp-success:   #198754;
    --lp-radius:    14px;
    --lp-shadow:    0 20px 60px rgba(26,58,92,.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Page wrapper ───────────────────────────────────────────── */
.lp-page {
    display:        flex;
    flex-direction: row;
    min-height:     100vh;
    background:     var(--lp-bg);
}

/* ═══════════════════════════════════════════════════════════════
   LEFT PANEL — Branding
═══════════════════════════════════════════════════════════════ */
.lp-brand {
    flex:            0 0 44%;
    width:           44%;
    min-height:      100vh;
    position:        relative;
    display:         flex;
    align-items:     center;
    justify-content: center;
    overflow:        hidden;
    background:      #1a3a5c;
    background:      linear-gradient(145deg, #1a3a5c 0%, #2563a8 100%);
}

/* Animated blobs */
.lp-blob {
    position:        absolute;
    border-radius:   50%;
    opacity:         .12;
    animation:       lp-float 8s ease-in-out infinite;
}
.lp-blob-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    top: -140px; left: -120px;
    animation-delay: 0s;
}
.lp-blob-2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, var(--lp-accent-lt) 0%, transparent 70%);
    bottom: -80px; right: -60px;
    animation-delay: 3s;
}
.lp-blob-3 {
    width: 180px; height: 180px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    top: 50%; right: 80px;
    animation-delay: 5s;
}

/* Subtle grid overlay */
.lp-grid-overlay {
    position:   absolute;
    inset:      0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

@keyframes lp-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-20px) scale(1.05); }
}

/* Brand inner content */
.lp-brand-inner {
    position:   relative;
    z-index:    2;
    max-width:  420px;
    padding:    3rem 2.5rem;
    color:      var(--lp-white);
}

/* Logo row */
.lp-logo-row {
    display:        flex;
    align-items:    center;
    gap:            .9rem;
}
.lp-logo-icon {
    width:           52px;
    height:          52px;
    border-radius:   14px;
    background:      rgba(255,255,255,.18);
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       1.5rem;
    color:           var(--lp-white);
    flex-shrink:     0;
    backdrop-filter: blur(6px);
    border:          1px solid rgba(255,255,255,.25);
}
.lp-logo-sm { width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem; }
.lp-sys-name {
    font-size:   1.25rem;
    font-weight: 800;
    letter-spacing: .01em;
    line-height:  1.1;
}
.lp-sys-tag {
    font-size:  .72rem;
    opacity:    .7;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Headline */
.lp-headline {
    font-size:   2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: .75rem;
}
.lp-hl {
    background: linear-gradient(90deg, #93c5fd, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.lp-subhead {
    font-size:  .9rem;
    opacity:    .75;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

/* Feature list */
.lp-feat-list {
    list-style:    none;
    padding:       0;
    margin-bottom: 1.75rem;
    display:       flex;
    flex-direction: column;
    gap:           .6rem;
}
.lp-feat-list li {
    display:     flex;
    align-items: center;
    gap:         .6rem;
    font-size:   .875rem;
    opacity:     .9;
}
.lp-feat-list li i {
    color:      #86efac;
    font-size:  .9rem;
    flex-shrink: 0;
}

/* Compliance badges */
.lp-badge-row {
    display:       flex;
    flex-wrap:     wrap;
    gap:           .5rem;
    margin-bottom: 1.75rem;
}
.lp-badge {
    display:         inline-flex;
    align-items:     center;
    gap:             .35rem;
    background:      rgba(255,255,255,.14);
    border:          1px solid rgba(255,255,255,.22);
    border-radius:   50px;
    padding:         .3rem .8rem;
    font-size:       .72rem;
    font-weight:     600;
    letter-spacing:  .04em;
    text-transform:  uppercase;
    backdrop-filter: blur(4px);
}

/* Stats row */
.lp-stats-row {
    display:        flex;
    align-items:    center;
    gap:            1.25rem;
    padding-top:    1.25rem;
    border-top:     1px solid rgba(255,255,255,.15);
}
.lp-stat-num {
    font-size:   1.6rem;
    font-weight: 800;
    line-height: 1;
}
.lp-stat-lbl {
    font-size:  .68rem;
    opacity:    .65;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: .15rem;
}
.lp-stat-sep {
    width:      1px;
    height:     32px;
    background: rgba(255,255,255,.2);
}

/* ═══════════════════════════════════════════════════════════════
   RIGHT PANEL — Form
═══════════════════════════════════════════════════════════════ */
.lp-form-side {
    flex:            1;
    min-width:       0;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    padding:         2.5rem 1.5rem;
    min-height:      100vh;
    background:      var(--lp-bg);
}

/* Mobile-only logo */
.lp-mobile-logo {
    align-items: center;
    gap:         .6rem;
    margin-bottom: 1.5rem;
}
.lp-mobile-name {
    font-size:   1.25rem;
    font-weight: 800;
    color:       var(--lp-primary);
}

/* Card */
.lp-card {
    width:         100%;
    max-width:     430px;
    background:    var(--lp-white);
    border-radius: 20px;
    box-shadow:    var(--lp-shadow);
    padding:       2.5rem 2.25rem;
    border:        1px solid var(--lp-border);
}

/* Card header */
.lp-card-head {
    text-align:    center;
    margin-bottom: 2rem;
}
.lp-card-avatar {
    width:           64px;
    height:          64px;
    border-radius:   50%;
    background:      linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
    color:           var(--lp-white);
    font-size:       1.6rem;
    display:         flex;
    align-items:     center;
    justify-content: center;
    margin:          0 auto 1rem;
    box-shadow:      0 8px 24px rgba(37,99,168,.3);
}
.lp-card-title {
    font-size:   1.5rem;
    font-weight: 800;
    color:       var(--lp-text);
    margin-bottom: .35rem;
}
.lp-card-sub {
    font-size: .875rem;
    color:     var(--lp-muted);
}

/* ── Form fields ─────────────────────────────────────────────── */
.lp-field {
    margin-bottom: 1.25rem;
}
.lp-label {
    display:       block;
    font-size:     .8rem;
    font-weight:   700;
    color:         var(--lp-text);
    margin-bottom: .45rem;
    letter-spacing: .01em;
}
.lp-label i {
    color:        var(--lp-accent);
    margin-right: .3rem;
    width:        14px;
}
.lp-input-wrap {
    position: relative;
}
.lp-input {
    width:         100%;
    padding:       .75rem 1rem;
    border:        2px solid var(--lp-border);
    border-radius: var(--lp-radius);
    font-size:     .9375rem;
    color:         var(--lp-text);
    background:    #f8fafc;
    transition:    border-color .2s, box-shadow .2s, background .2s;
    outline:       none;
}
.lp-input::placeholder { color: #a0aec0; }
.lp-input:focus {
    border-color: var(--lp-accent);
    background:   var(--lp-white);
    box-shadow:   0 0 0 3px rgba(37,99,168,.12);
}
.lp-input.is-valid   { border-color: var(--lp-success); background: #f0fdf4; }
.lp-input.is-invalid { border-color: var(--lp-danger);  background: #fef2f2; }

/* Password wrapper */
.lp-pw-wrap .lp-input { padding-right: 3rem; }
.lp-pw-toggle {
    position:         absolute;
    right:            .75rem;
    top:              50%;
    transform:        translateY(-50%);
    background:       none;
    border:           none;
    color:            var(--lp-muted);
    cursor:           pointer;
    padding:          .25rem;
    font-size:        .95rem;
    transition:       color .2s;
}
.lp-pw-toggle:hover { color: var(--lp-accent); }

/* Remember me */
.lp-remember {
    margin-bottom: 1.25rem;
}
.lp-check-label {
    display:     flex;
    align-items: center;
    gap:         .55rem;
    font-size:   .875rem;
    color:       var(--lp-muted);
    cursor:      pointer;
    user-select: none;
}
.lp-check { display: none; }
.lp-check-custom {
    width:         18px;
    height:        18px;
    border:        2px solid var(--lp-border);
    border-radius: 5px;
    flex-shrink:   0;
    display:       flex;
    align-items:   center;
    justify-content: center;
    transition:    background .2s, border-color .2s;
}
.lp-check:checked + .lp-check-custom {
    background:    var(--lp-accent);
    border-color:  var(--lp-accent);
}
.lp-check:checked + .lp-check-custom::after {
    content:    '';
    width:      5px;
    height:     9px;
    border:     2px solid #fff;
    border-top: none;
    border-left: none;
    transform:  rotate(45deg) translateY(-1px);
    display:    block;
}

/* reCAPTCHA */
.lp-captcha-wrap {
    margin-bottom: 1.5rem;
    overflow:      hidden;
}
.lp-captcha-wrap .g-recaptcha { transform-origin: left top; }

/* Submit button */
.lp-btn-submit {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           100%;
    padding:         .85rem 1.5rem;
    background:      linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
    color:           var(--lp-white);
    border:          none;
    border-radius:   var(--lp-radius);
    font-size:       1rem;
    font-weight:     700;
    cursor:          pointer;
    transition:      transform .2s, box-shadow .2s, filter .2s;
    box-shadow:      0 6px 20px rgba(37,99,168,.35);
    margin-bottom:   1.25rem;
    letter-spacing:  .01em;
}
.lp-btn-submit:hover {
    filter:    brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(37,99,168,.4);
}
.lp-btn-submit:active {
    transform:  translateY(0);
    box-shadow: 0 4px 12px rgba(37,99,168,.3);
}
.lp-btn-submit:disabled {
    opacity:   .7;
    cursor:    not-allowed;
    transform: none;
}
.lp-spinner {
    display:       inline-block;
    width:         16px;
    height:        16px;
    border:        2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation:     lp-spin .65s linear infinite;
    margin-right:  .5rem;
    vertical-align: middle;
}
@keyframes lp-spin { to { transform: rotate(360deg); } }

/* Trust / security row */
.lp-trust-row {
    display:         flex;
    justify-content: center;
    gap:             1rem;
    font-size:       .72rem;
    color:           var(--lp-muted);
    flex-wrap:       wrap;
    margin-bottom:   .5rem;
}
.lp-trust-row span {
    display:     flex;
    align-items: center;
    gap:         .3rem;
}
.lp-trust-row i {
    color:     var(--lp-accent);
    font-size: .7rem;
}

/* Back link */
.lp-back-link {
    font-size:       .85rem;
    color:           var(--lp-muted);
    text-decoration: none;
    transition:      color .2s;
}
.lp-back-link:hover { color: var(--lp-accent); }

/* Footer copy */
.lp-copy {
    margin-top: 1.5rem;
    font-size:  .75rem;
    color:      #94a3b8;
    text-align: center;
}

/* ── Alert messages (toast-style, top-right) ─────────────────── */
#alertContainer {
    margin-bottom: 1rem;
}
.alert {
    border:        none;
    border-radius: 10px;
    font-size:     .875rem;
    font-weight:   500;
    padding:       .85rem 1rem;
    display:       flex;
    align-items:   flex-start;
    gap:           .6rem;
    box-shadow:    0 4px 16px rgba(0,0,0,.1);
    animation:     lp-slide-in .3s ease-out;
}
@keyframes lp-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-danger  { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--lp-danger); }
.alert-success { background: #f0fdf4; color: #14532d; border-left: 4px solid var(--lp-success); }
.alert-warning { background: #fffbeb; color: #78350f; border-left: 4px solid #f59e0b; }
.alert-info    { background: #eff6ff; color: #1e3a8a; border-left: 4px solid var(--lp-accent); }
.alert .btn-close { margin-left: auto; }

/* ── Responsive ─────────────────────────────────────────────── */

/* Mobile logo: hidden on desktop, visible on mobile */
.lp-mobile-logo { display: none; }

@media (max-width: 991.98px) {
    /* Hide the left branding panel on smaller screens */
    .lp-brand { display: none; }

    /* Mobile logo shows */
    .lp-mobile-logo {
        display:     flex;
        align-items: center;
        gap:         .6rem;
        margin-bottom: 1.5rem;
    }

    .lp-form-side {
        flex:       1;
        padding:    2rem 1.25rem;
        background: var(--lp-bg);
    }
    .lp-card {
        max-width: 480px;
        padding:   2rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .lp-card {
        padding:       1.5rem 1.25rem;
        border-radius: 16px;
    }
    .lp-card-title { font-size: 1.3rem; }
    .lp-btn-submit { font-size: .9rem; }
    .lp-captcha-wrap .g-recaptcha {
        transform:       scale(.87);
        transform-origin: left top;
    }
    .lp-trust-row { gap: .6rem; font-size: .68rem; }
}
