/**
 * EMLearn – Login Landing Page
 *
 * Sleek two-pane auth layout (left branded image panel + right login card),
 * matching the Refract design. Enqueued only on pages containing the
 * [emlearn_login] shortcode (see includes/core/login-page.php).
 *
 * @package EMLearn
 */

/* Full-screen template: drop body chrome so the layout sits flush. */
body.emlearn-login-screen {
    margin: 0;
    padding: 0;
    background: #fff;
}

.emlearn-auth {
    --ea-accent:      #4458e4;   /* Refract login button blue   */
    --ea-accent-dark: #3343b8;   /* hover                       */
    --ea-ink:         #1f2937;   /* headings                    */
    --ea-muted:       #6b7280;   /* sub text / labels           */
    --ea-border:      #d8dce3;   /* input borders               */
    --ea-radius:      10px;

    display: flex;
    min-height: 100vh;
    width: 100%;
    font-family: Calibri, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ea-ink);
    background: #fff;
}

/* ============================ Left: brand panel ========================== */
.emlearn-auth__brand {
    position: relative;
    flex: 1 1 56%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: stretch;
    color: #fff;
}

/* Dark gradient so white copy stays legible over the photo */
.emlearn-auth__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 23, 42, 0.86) 0%, rgba(13, 23, 42, 0.55) 100%);
}

.emlearn-auth__brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.4rem;
    max-width: 900px;
    margin: auto;
    padding: 3.5rem 2.75rem;
}

.emlearn-auth__logo {
    width: 210px;
    max-width: 60%;
    height: auto;
}

.emlearn-auth__copy p {
    font-size: 1.02rem;
    line-height: 1.7;
    margin: 0 0 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.emlearn-auth__copy-heading {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.2rem;
    color: #fff;
}

.emlearn-auth__copy-lead {
    font-weight: 600;
    color: #fff !important;
    margin-bottom: 0 !important;
}

/* ============================ Right: login card ========================== */
.emlearn-auth__panel {
    flex: 1 1 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: #fff;
}

.emlearn-auth__card {
    width: 100%;
    max-width: 380px;
}

.emlearn-auth__heading {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--ea-ink);
}

.emlearn-auth__sub {
    font-size: 1rem;
    color: var(--ea-muted);
    margin: 0 0 2rem;
}

/* Inline error banner (seamless failed-login feedback) */
.emlearn-auth__notice {
    background: #fdecec;
    border: 1px solid #f3b7b7;
    color: #9b1c1c;
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 0.7rem 0.9rem;
    border-radius: var(--ea-radius);
    margin: 0 0 1.4rem;
}

.emlearn-auth__form {
    display: block;
}

.emlearn-auth__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ea-ink);
    margin-bottom: 0.4rem;
}

.emlearn-auth__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.emlearn-auth__forgot {
    font-size: 0.82rem;
    color: var(--ea-accent);
    text-decoration: none;
}

.emlearn-auth__forgot:hover {
    text-decoration: underline;
}

.emlearn-auth__input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 0.95rem;
    font-size: 1rem;
    color: var(--ea-ink);
    background: #fff;
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    margin-bottom: 0.25rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emlearn-auth__input::placeholder {
    color: #aab1bd;
}

.emlearn-auth__input:focus {
    outline: none;
    border-color: var(--ea-accent);
    box-shadow: 0 0 0 3px rgba(68, 88, 228, 0.15);
}

.emlearn-auth__remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--ea-muted);
    margin: 1.1rem 0 1.6rem;
    cursor: pointer;
}

.emlearn-auth__remember input {
    width: auto;
    margin: 0;
}

.emlearn-auth__btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    font-size: 1.02rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--ea-accent);
    border: none;
    border-radius: var(--ea-radius);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.emlearn-auth__btn:hover {
    background: var(--ea-accent-dark);
    color: #fff;
}

.emlearn-auth__btn:active {
    transform: translateY(1px);
}

.emlearn-auth__alt {
    text-align: center;
    font-size: 0.9rem;
    color: var(--ea-muted);
    margin: 1.6rem 0 0;
}

.emlearn-auth__alt a {
    color: var(--ea-accent);
    font-weight: 600;
    text-decoration: none;
}

.emlearn-auth__alt a:hover {
    text-decoration: underline;
}

/* Emcorp Group logo at the top of the login card */
.emlearn-auth__cardlogo {
    display: block;
    height: 46px;
    width: auto;
    margin: 0 0 1.8rem;
}

/* ============================ Logged-in state ============================ */
.emlearn-auth--loggedin {
    background-size: cover;
    background-position: center;
    align-items: center;
    justify-content: center;
    position: relative;
}

.emlearn-auth--loggedin::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(13, 23, 42, 0.7);
}

.emlearn-auth__card--standalone {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.emlearn-auth__logo--dark {
    margin: 0 auto 1.5rem;
    display: block;
    /* white logo on a white card — tint it dark for visibility */
    filter: brightness(0) saturate(100%);
    opacity: 0.85;
    width: 180px;
}

.emlearn-auth__card--standalone .emlearn-auth__btn {
    margin-top: 1.5rem;
}

/* ============================ Responsive ================================= */
@media (max-width: 860px) {
    .emlearn-auth {
        flex-direction: column;
        min-height: auto;
    }

    .emlearn-auth__brand {
        flex: none;
        min-height: 360px;
    }

    .emlearn-auth__brand-inner {
        padding: 3rem 2rem;
        gap: 1.6rem;
    }

    .emlearn-auth__panel {
        flex: none;
        padding: 2.75rem 1.5rem 3.5rem;
    }
}

@media (max-width: 480px) {
    .emlearn-auth__brand {
        min-height: 260px;
    }

    .emlearn-auth__copy-heading {
        font-size: 1.6rem;
    }
}
