/* =========================================================
   Login page – custom styles
   ========================================================= */

:root {
    --lg-primary: #b22bc7;
    --lg-primary-dark: #7b1fa2;
    --lg-primary-soft: #f6ebfa;
    --lg-accent: #e86ad8;
    --lg-text: #2b2440;
    --lg-muted: #7a7490;
    --lg-border: #e7e2ef;
    --lg-bg: #f7f4fb;
    --lg-radius: 20px;
}

body.lg-page {
    background: var(--lg-bg);
    color: var(--lg-text);
    min-height: 100vh;
}

/* ---------- Background decoration ---------- */
.lg-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 24px;
    overflow: hidden;
}

.lg-wrapper::before,
.lg-wrapper::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .45;
    z-index: 0;
    pointer-events: none;
}

.lg-wrapper::before {
    width: 480px;
    height: 480px;
    top: -160px;
    left: -140px;
    background: #e9b8f2;
}

.lg-wrapper::after {
    width: 420px;
    height: 420px;
    bottom: -160px;
    right: -120px;
    background: #c6c3ff;
}

/* ---------- Card ---------- */
.lg-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    display: flex;
    background: #fff;
    border-radius: var(--lg-radius);
    box-shadow: 0 20px 60px rgba(76, 35, 110, .12), 0 2px 8px rgba(76, 35, 110, .05);
    overflow: hidden;
    animation: lg-fade-up .5s ease both;
}

@keyframes lg-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Brand panel (left) ---------- */
.lg-brand {
    flex: 1 1 50%;
    position: relative;
    padding: 48px 44px;
    color: #fff;
    background: linear-gradient(145deg, #8e24aa 0%, #b22bc7 55%, #e86ad8 100%);
    display: flex;
    flex-direction: column;
}

.lg-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.lg-brand > * {
    position: relative;
    z-index: 1;
}

.lg-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
    text-decoration: none !important;
}

.lg-brand-logo img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    object-fit: contain;
}

.lg-brand-logo span {
    font-family: 'PoppinLatin', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.2;
}

.lg-brand-title {
    margin: 36px 0 8px;
    font-family: 'PoppinLatin', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.lg-brand-sub {
    font-size: 15px;
    opacity: .9;
    margin-bottom: 28px;
}

.lg-brand-image {
    margin-top: auto;
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 12px 30px rgba(40, 0, 60, .25);
}

.lg-brand-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ---------- Form panel (right) ---------- */
.lg-form {
    flex: 1 1 50%;
    padding: 48px 48px 32px;
    display: flex;
    flex-direction: column;
}

.lg-form-head h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--lg-text);
    margin: 0 0 4px;
}

.lg-form-head p {
    color: var(--lg-muted);
    font-size: 14px;
    margin: 0 0 28px;
}

/* Segmented tabs */
.lg-tabs {
    display: flex;
    gap: 4px;
    padding: 5px;
    margin: 0 0 24px;
    list-style: none;
    background: #f3eff8;
    border-radius: 14px;
    border: none;
}

.lg-tabs .nav-item {
    flex: 1;
    margin: 0;
}

.lg-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: none !important;
    border-radius: 10px !important;
    color: var(--lg-muted);
    font-weight: 600;
    font-size: 14px;
    background: transparent;
    transition: all .2s ease;
}

.lg-tabs .nav-link i {
    font-size: 15px;
    color: inherit;
}

.lg-tabs .nav-link:hover {
    color: var(--lg-primary);
}

.lg-tabs .nav-link.active {
    background: #fff !important;
    color: var(--lg-primary) !important;
    box-shadow: 0 2px 8px rgba(76, 35, 110, .12);
}

.lg-tabs .nav-link.active i {
    color: var(--lg-primary) !important;
}

/* SSO pane */
.lg-sso {
    text-align: center;
    padding: 12px 0 8px;
}

.lg-sso-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lg-primary-soft);
    color: var(--lg-primary);
    font-size: 30px;
}

.lg-sso p {
    color: var(--lg-muted);
    font-size: 14px;
    margin-bottom: 22px;
}

/* Primary button (SSO + admin login) */
.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    background: linear-gradient(90deg, #9c27b0 0%, #d24fd0 100%);
    box-shadow: 0 8px 20px rgba(178, 43, 199, .3);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.lg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(178, 43, 199, .38);
    filter: brightness(1.05);
}

.lg-btn:active {
    transform: translateY(0);
}

.lg-btn:focus-visible {
    outline: 3px solid rgba(178, 43, 199, .35);
    outline-offset: 2px;
}

/* Inputs */
.lg-field {
    margin-bottom: 18px;
}

.lg-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-text);
    margin-bottom: 6px;
}

.lg-input {
    position: relative;
}

.lg-input > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a9a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color .2s ease;
}

.lg-input .form-control {
    height: 50px;
    padding-left: 46px;
    padding-right: 46px;
    border: 1.5px solid var(--lg-border);
    border-radius: 12px;
    background: #fbfafd;
    font-size: 15px;
    color: var(--lg-text);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.lg-input .form-control::placeholder {
    color: #b5afc4;
}

.lg-input .form-control:focus {
    border-color: var(--lg-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(178, 43, 199, .12);
}

.lg-input:focus-within > i {
    color: var(--lg-primary);
}

.lg-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a9a3b8;
    cursor: pointer;
}

.lg-toggle-pass:hover {
    color: var(--lg-primary);
    background: var(--lg-primary-soft);
}

/* Contact + links */
.lg-contact {
    margin-top: auto;
    padding-top: 28px;
    border-top: 1px dashed var(--lg-border);
    font-size: 13px;
    color: var(--lg-muted);
}

.lg-contact-title {
    font-weight: 700;
    color: var(--lg-text);
    font-size: 14px;
    margin-bottom: 10px;
}

.lg-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.lg-contact-item i {
    color: var(--lg-primary);
    width: 16px;
    margin-top: 3px;
    text-align: center;
}

.lg-old-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #e0405a !important;
    background: #ffeef1;
    text-decoration: none !important;
    transition: background .2s ease;
}

.lg-old-link:hover {
    background: #ffdde3;
}

/* Footer */
.lg-footer {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    font-size: 13px;
    color: var(--lg-muted);
    text-align: center;
}

/* ---------- Welcome popup ---------- */
.lg-popup {
    display: none;
    width: 70%;
    max-width: 900px;
    border-radius: 16px;
    padding: 0 !important;
    overflow: hidden;
}

.lg-popup img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .lg-card {
        flex-direction: column;
        max-width: 520px;
    }

    .lg-brand {
        padding: 28px 28px 24px;
    }

    .lg-brand-title {
        margin-top: 20px;
        font-size: 24px;
    }

    .lg-brand-sub {
        margin-bottom: 0;
    }

    .lg-brand-image {
        display: none;
    }

    .lg-form {
        padding: 32px 28px 24px;
    }
}

@media (max-width: 575.98px) {
    .lg-wrapper {
        padding-top: 16px;
    }

    .lg-popup {
        width: 95%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-card { animation: none; }
    .lg-btn, .lg-tabs .nav-link { transition: none; }
}
