/**
 * Modern Construction Company Login Styles
 * Shared styles for Admin & Employee login pages
 * AACD HRMIS - Human Resource Management Information System
 */

/* ============================================================
   BASE RESET & BODY
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.login,
body.employee-login {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Make the app-container a flex column that stretches */
body.login .app-container,
body.employee-login .app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Hide loading overlay on login pages */
body.login #loading-overlay,
body.employee-login #loading-overlay {
    display: none !important;
}

/* ============================================================
   LOGIN PAGE LAYOUT - SPLIT SCREEN
   ============================================================ */
.lp-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    flex: 1;        /* fill app-container height */
}

/* LEFT PANEL - Branding/Visual */
.lp-left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    overflow: hidden;
    background: #1a252f;
}

/* Layered background using pseudo-elements */
.lp-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(255,205,17,0.18) 0%, transparent 55%),
        linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 60%);
    z-index: 1;
}

/* Construction-pattern overlay */
.lp-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255,205,17,0.04) 0px,
            rgba(255,205,17,0.04) 1px,
            transparent 1px,
            transparent 28px
        );
    z-index: 1;
}

.lp-left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* Brand top */
.lp-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.lp-brand-logo {
    width: 220px;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 10px;
}

/* Hero text */
.lp-hero {
    padding: 20px 0;
}

.lp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,205,17,0.2);
    border: 1px solid rgba(255,205,17,0.4);
    color: #E6B800;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.lp-hero-badge i {
    font-size: 10px;
}

.lp-hero h1 {
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.lp-hero h1 em {
    font-style: normal;
    color: #FFCD11;
}

.lp-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
    max-width: 380px;
}

/* Stats row */
.lp-stats {
    display: flex;
    gap: 28px;
    margin-top: 36px;
}

.lp-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lp-stat strong {
    font-size: 22px;
    font-weight: 800;
    color: #FFCD11;
    line-height: 1;
}

.lp-stat span {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Features list */
.lp-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 0;
}

.lp-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.75);
    font-size: 13.5px;
}

.lp-feature i {
    width: 30px;
    height: 30px;
    background: rgba(255,205,17,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFCD11;
    font-size: 13px;
    flex-shrink: 0;
}

/* Bottom tagline */
.lp-tagline {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.lp-tagline strong {
    color: rgba(255,255,255,0.55);
}

/* ============================================================
   RIGHT PANEL - Login Form
   ============================================================ */
.lp-right {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f0;
    padding: 48px 40px;
    position: relative;
}

/* Subtle texture */
.lp-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 80% 20%, rgba(255,205,17,0.05) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(44,62,80,0.04) 0%, transparent 50%);
    pointer-events: none;
}

.lp-form-wrap {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: lpFadeUp 0.5s ease-out both;
}

@keyframes lpFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Form Header ---- */
.lp-form-header {
    margin-bottom: 32px;
}

.lp-portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
}

/* Admin badge - caterpillar yellow */
.lp-portal-badge.admin {
    background: rgba(255,205,17,0.12);
    color: #E6B800;
    border: 1px solid rgba(255,205,17,0.25);
}

/* Employee badge - steel */
.lp-portal-badge.employee {
    background: rgba(44,62,80,0.1);
    color: #2C3E50;
    border: 1px solid rgba(44,62,80,0.2);
}

.lp-portal-badge i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    background: currentColor;
    color: #fff;
}

.lp-portal-badge.admin i { background: #E6B800; }
.lp-portal-badge.employee i { background: #2C3E50; }

.lp-form-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1a252f;
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin-bottom: 6px;
}

.lp-form-header p {
    font-size: 13.5px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* Switch link - link to the other portal */
.lp-switch-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    color: #E6B800;
    margin-top: 6px;
    transition: gap 0.2s ease;
}

.lp-switch-link:hover {
    gap: 8px;
    color: #CCa800;
}

.lp-switch-link i {
    font-size: 11px;
}

/* ---- Form Fields ---- */
.lp-field {
    margin-bottom: 18px;
}

.lp-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 7px;
}

.lp-input-wrap {
    position: relative;
}

.lp-input-wrap i.lp-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b0bec5;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.lp-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 1.5px solid #dde1e7;
    border-radius: 10px;
    font-size: 14px;
    color: #1a252f;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lp-input-wrap input::placeholder {
    color: #c5ccd4;
}

.lp-input-wrap input:focus {
    border-color: #FFCD11;
    box-shadow: 0 0 0 3px rgba(255,205,17,0.1);
}

.lp-input-wrap input:focus + i.lp-input-icon,
.lp-input-wrap i.lp-input-icon-left-focus {
    color: #FFCD11;
}

/* Focus state for left icon */
.lp-input-wrap:focus-within i.lp-input-icon {
    color: #FFCD11;
}

/* Password toggle button */
.lp-pw-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #b0bec5;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.lp-pw-toggle:hover { color: #FFCD11; }

/* Error state */
.lp-input-wrap input.is-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.08);
}

.lp-field-error {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 12px;
    color: #e74c3c;
    font-weight: 500;
}

.lp-field-error.visible {
    display: flex;
}

/* ---- Remember / Forgot Row ---- */
.lp-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.lp-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lp-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #FFCD11;
    cursor: pointer;
}

.lp-remember span {
    font-size: 13px;
    color: #5d6d7e;
    font-weight: 500;
}

.lp-forgot {
    font-size: 13px;
    font-weight: 600;
    color: #E6B800;
    text-decoration: none;
    transition: color 0.2s;
}

.lp-forgot:hover { color: #CCa800; }

/* ---- Submit Button ---- */
.lp-submit {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* Admin button - caterpillar yellow */
.lp-submit.admin-btn {
    background: linear-gradient(135deg, #FFCD11 0%, #E6B800 100%);
    color: #1A252F;
    box-shadow: 0 4px 18px rgba(255,205,17,0.35);
}

.lp-submit.admin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255,205,17,0.45);
}

/* Employee button - caterpillar yellow */
.lp-submit.employee-btn {
    background: linear-gradient(135deg, #FFCD11 0%, #E6B800 100%);
    color: #1A252F;
    box-shadow: 0 4px 18px rgba(255,205,17,0.35);
}

.lp-submit.employee-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255,205,17,0.45);
}

.lp-submit:active:not(:disabled) {
    transform: translateY(0);
}

.lp-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading spinner inside button */
.lp-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lpSpin 0.7s linear infinite;
}

.lp-submit.loading .lp-btn-text { display: none; }
.lp-submit.loading .lp-btn-icon { display: none; }
.lp-submit.loading .lp-spinner { display: block; }

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

/* ---- Alert message ---- */
.lp-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 18px;
    animation: lpSlideIn 0.25s ease-out;
}

@keyframes lpSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lp-alert.visible { display: flex; }

.lp-alert.error {
    background: rgba(231,76,60,0.08);
    border: 1px solid rgba(231,76,60,0.25);
    color: #c0392b;
}

.lp-alert.success {
    background: rgba(39,174,96,0.08);
    border: 1px solid rgba(39,174,96,0.25);
    color: #1e8449;
}

.lp-alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ---- Divider ---- */
.lp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #bdc3c7;
    font-size: 12px;
}

.lp-divider::before,
.lp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e4e8;
}

/* ---- Other portal link ---- */
.lp-other-portal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 10px;
    border: 1.5px solid #e0e4e8;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    color: #34495e;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lp-other-portal:hover {
    border-color: #FFCD11;
    color: #E6B800;
    background: rgba(255,205,17,0.04);
    transform: translateY(-1px);
}

.lp-other-portal i {
    font-size: 16px;
}

/* ---- Footer note ---- */
.lp-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e8eaec;
    text-align: center;
    font-size: 11.5px;
    color: #b0bec5;
    line-height: 1.6;
}

.lp-footer a {
    color: #95a5a6;
    text-decoration: none;
}

.lp-footer a:hover { color: #FFCD11; }

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 900px) {
    .lp-wrap {
        grid-template-columns: 1fr;
    }

    .lp-left {
        padding: 30px 28px;
        min-height: 220px;
    }

    .lp-hero h1 { font-size: 26px; }
    .lp-hero p  { font-size: 14px; }

    .lp-stats   { gap: 20px; }

    .lp-features { display: none; } /* hide feature list on mobile */

    .lp-right {
        padding: 36px 24px;
    }
}

@media (max-width: 480px) {
    .lp-left { padding: 24px 20px; min-height: 180px; }
    .lp-hero h1 { font-size: 22px; }

    .lp-right { padding: 28px 16px; }
    .lp-form-wrap { max-width: 100%; }

    .lp-form-header h2 { font-size: 22px; }

    .lp-input-wrap input { height: 46px; font-size: 16px; }
    .lp-submit { height: 48px; }
}
