/**
 * SomElearning — Split login
 * Left: designed background + logo | Right: form
 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap');

.login-page-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    background: #f4f8f6;
    color: #13261c;
}

.login-page-body .navbar-spacer,
.login-page-body .site-footer,
.login-page-body footer { display: none !important; }

.login-page-body .main-content {
    flex: 1 1 auto;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    background: transparent;
}

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

.login-split {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 100vh;
}

/* ===== LEFT: colored panel + logo as BACKGROUND ===== */
.login-left {
    position: relative;
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    color: #fff;
    background-color: #0b3d2e;
}

.login-left-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #0b3d2e;
    background-image:
        radial-gradient(90% 70% at 12% 18%, rgba(55, 180, 110, 0.38), transparent 55%),
        radial-gradient(80% 60% at 90% 85%, rgba(0, 0, 0, 0.28), transparent 50%),
        linear-gradient(155deg, #041f17 0%, #0b3d2e 45%, #146644 100%);
}

/* System logo used as large background watermark */
.login-bg-logo {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    width: min(78%, 520px);
    height: min(78%, 520px);
    max-width: 520px;
    max-height: 520px;
    object-fit: contain;
    object-position: center;
    opacity: 0.26;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    padding: 2.5rem;
    box-sizing: border-box;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.22));
}

.login-left.has-logo-bg .login-left-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 45%, transparent 20%, rgba(4, 31, 23, 0.35) 70%, rgba(4, 31, 23, 0.55) 100%);
    pointer-events: none;
}

.login-mesh {
    position: absolute;
    inset: -10%;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: rotate(-5deg);
    mask-image: radial-gradient(ellipse 80% 70% at 40% 45%, #000 15%, transparent 75%);
}

.login-orb {
    position: absolute;
    border-radius: 50%;
}

.login-orb-1 {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -70px;
    background: rgba(47, 191, 116, 0.22);
    animation: loginFloat 11s ease-in-out infinite;
}

.login-orb-2 {
    width: 240px;
    height: 240px;
    bottom: -80px;
    left: -50px;
    background: rgba(255, 255, 255, 0.08);
    animation: loginFloat 13s ease-in-out 1s infinite reverse;
}

.login-left-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    animation: loginRise 0.7s ease both;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
.login-back:hover { color: #fff; }

.login-brand {
    text-align: left;
}

.login-logo-ring {
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.login-logo-ring--form {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.75rem;
    border: 3px solid #e5f2ea;
    box-shadow: 0 8px 20px rgba(11, 47, 36, 0.1);
    padding: 8px;
}

.login-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center;
    border-radius: 0 !important;
    display: block;
    background: transparent;
}

.login-logo-fallback-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #146644, #1f8f5a);
    color: #fff;
    font-size: 2rem;
}

.login-brand-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2.1rem, 4vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #fff;
}

.login-brand-text {
    margin: 0;
    max-width: 32ch;
    font-size: 1.05rem;
    line-height: 1.65;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

/* ===== RIGHT: logo + form ===== */
.login-right {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        radial-gradient(circle at 100% 0%, rgba(47, 191, 116, 0.1), transparent 42%),
        linear-gradient(180deg, #f7fbf8 0%, #eef5f1 100%);
}

.login-panel {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 22px;
    padding: 2rem 1.85rem 1.75rem;
    border: 1px solid rgba(18, 36, 26, 0.06);
    box-shadow: 0 18px 44px rgba(18, 36, 26, 0.08);
    animation: loginRise 0.7s ease 0.08s both;
}

.login-panel-head {
    margin-bottom: 1.35rem;
    text-align: center;
}

.login-panel-brand {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0d2b1f;
}

.login-form-title {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0d2b1f;
}

.login-form-sub {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #667870;
    line-height: 1.5;
}

.login-alert {
    border-radius: 12px;
    padding: 0.8rem 0.95rem;
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.login-alert-ok { background: #e8f8ef; color: #146644; }
.login-alert-err { background: #fdeceb; color: #9b2c2c; }

.login-form { width: 100%; }
.login-field { margin-bottom: 1.1rem; }

.login-field label,
.login-label-row label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a3024;
}

.login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.login-label-row label { margin-bottom: 0; }

.login-forgot {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1b8f5a;
    text-decoration: none;
    white-space: nowrap;
}
.login-forgot:hover {
    color: #0d3d2d;
    text-decoration: underline;
}

.login-field input[type="email"],
.login-field input[type="text"],
.login-field input[type="password"],
.login-pass input {
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 1rem;
    border: 1.5px solid #d5e3da;
    border-radius: 12px;
    background: #f8fbf9;
    color: #13261c;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.login-field input::placeholder,
.login-pass input::placeholder { color: #93a59b; }

.login-field input:focus,
.login-pass input:focus {
    border-color: #1b8f5a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(27, 143, 90, 0.12);
}

.login-field input.is-invalid,
.login-pass input.is-invalid {
    border-color: #c0392b;
    box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.1);
}

.login-field-error {
    display: block;
    min-height: 1.1em;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c0392b;
}

.login-pass { position: relative; }
.login-pass input { padding-right: 3.2rem; }

.login-pass-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6b7f74;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.login-pass-toggle:hover {
    color: #1b8f5a;
    background: rgba(27, 143, 90, 0.08);
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.15rem 0 1.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5f7268;
    cursor: pointer;
    user-select: none;
}
.login-remember input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: #1b8f5a;
    flex-shrink: 0;
}

.login-submit {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 54px;
    margin: 0;
    padding: 0.9rem 1.2rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #22a865 0%, #167a4c 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(22, 122, 76, 0.28);
    transition: transform 0.2s ease, filter 0.2s ease;
}
.login-submit:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-1px);
}
.login-submit:disabled {
    opacity: 0.9;
    cursor: wait;
}

.login-footer {
    margin: 1.45rem 0 0;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 500;
    color: #667870;
}
.login-footer a {
    font-weight: 700;
    color: #1b8f5a;
    text-decoration: none;
}
.login-footer a:hover {
    color: #0d3d2d;
    text-decoration: underline;
}

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

@keyframes loginFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(10px, -14px, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .login-left-inner,
    .login-panel,
    .login-orb { animation: none !important; }
}

@media (max-width: 991px) {
    .login-split {
        flex-direction: column !important;
        min-height: auto;
    }

    .login-left,
    .login-right {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .login-left {
        min-height: 320px;
        padding: 1.75rem 1.35rem 2rem;
        align-items: flex-end;
    }

    .login-bg-logo {
        width: min(70%, 280px);
        height: min(70%, 280px);
        opacity: 0.16;
    }

    .login-left-inner { max-width: none; }
    .login-back { margin-bottom: 1.4rem; }
    .login-brand-text { max-width: 42ch; }

    .login-right { padding: 1.5rem 1rem 2.25rem; }
}

@media (max-width: 575px) {
    .login-left { min-height: 260px; }
    .login-logo-ring--form { width: 64px; height: 64px; }
    .login-brand-title { font-size: 1.85rem; }
    .login-panel {
        padding: 1.45rem 1.2rem 1.3rem;
        border-radius: 18px;
    }
    .login-form-title { font-size: 1.55rem; }
}
