/* ==================================================================
   Login / OTP / Register — "ERP Enterprise Split"
   ------------------------------------------------------------------
   Views/Account/Login.cshtml sets Layout = null, so this page loads no
   Bootstrap and no site stylesheet. Everything it needs is here,
   including the few generic class names the markup and jQuery
   unobtrusive validation depend on: .hidden, .alert, .text-danger,
   .form-control, .input-validation-error, .field-validation-error.
   Renaming those would silently break validation styling, so they keep
   their names; everything structural is prefixed lg-.

   Colours are the app's own, taken from _Layout.cshtml - navy #131426
   (the sidebar) and red #e53e3e (the accent) - so this screen hands
   over to the rest of the app without a palette change.
   ================================================================== */

:root{
    --lg-navy: #131426;
    --lg-navy-2: #1d1f3a;
    --lg-red: #e53e3e;
    --lg-red-2: #c82333;

    --lg-ink: #1f2430;
    --lg-ink-2: #5b6472;
    --lg-ink-3: #8b94a3;

    --lg-line: #e3e6ec;
    --lg-field: #fbfcfd;
    --lg-green: #1f9d55;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    font-family: system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    color: var(--lg-ink);
    background: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* A grid item is min-width:auto by default, so it refuses to shrink
   below its content and pushes the page sideways on a phone. Both
   columns have to be told they may shrink. */
.lg-brand,
.lg-pane { min-width: 0; }

/* ---------------- left: brand panel ---------------- */

.lg-brand {
    position: relative;
    overflow: hidden;
    padding: 46px clamp(30px, 4.5vw, 66px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    background: linear-gradient(165deg, var(--lg-navy-2), var(--lg-navy) 62%);
    color: #fff;
}

/* A faint ledger rule, so the panel is not a flat block of navy. */
.lg-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .45;
    background: repeating-linear-gradient(0deg, transparent 0 37px, rgba(255,255,255,.045) 37px 38px);
}

.lg-brand::after {
    content: '';
    position: absolute;
    right: -180px;
    top: -120px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229,62,62,.3), transparent 66%);
}

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

.lg-logo { display: flex; align-items: center; gap: 13px; }

/* The logo art already carries the MUNEEM JI wordmark, so nothing is
   set beside it - a second wordmark would just repeat the picture. */
/* The art is portrait, so height drives it. Below about 120px the
   MUNEEM JI band under the character stops being readable. */
.lg-logo img {
    height: 124px;
    width: auto;
    display: block;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,.5));
}

.lg-pitch { max-width: 30ch; }

.lg-pitch h1 {
    font-size: clamp(26px, 2.9vw, 37px);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.9px;
}

.lg-pitch p {
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.75;
    color: #b8bdcc;
}

.lg-points {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lg-point {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 13.5px;
    color: #d6dae5;
}

.lg-point i {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    margin-top: 1px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(229,62,62,.18);
    color: var(--lg-red);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
}

.lg-brand-foot { font-size: 11.5px; color: #7e8599; }

/* ---------------- right: the form ---------------- */

.lg-pane {
    display: grid;
    place-items: center;
    padding: 44px clamp(24px, 4vw, 56px);
    overflow-y: auto;
}

.lg-form { width: min(390px, 100%); }

.lg-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--lg-red);
    margin-bottom: 9px;
}

.lg-form h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.6px;
    margin-bottom: 8px;
}

.lg-sub {
    font-size: 14px;
    color: var(--lg-ink-2);
    line-height: 1.65;
    margin-bottom: 28px;
}

/* The sign-in pane carries no sub-line, so the heading has to supply
   the gap the sub-line would otherwise leave above the first field. */
#loginForm h2 { margin-bottom: 26px; }

/* ---------------- fields ---------------- */

.form-group { margin-bottom: 20px; }

.form-group label,
.checkbox-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--lg-ink);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--lg-ink);
    background: var(--lg-field);
    border: 1px solid var(--lg-line);
    border-radius: 8px;
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.form-control::placeholder { color: #a9b1be; }

.form-control:focus {
    border-color: var(--lg-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(229,62,62,.12);
}

/* jQuery unobtrusive validation marks the field itself. */
.form-control.input-validation-error {
    border-color: var(--lg-red);
    background: #fff7f7;
}

.login-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: .2px;
    color: #fff;
    background: linear-gradient(135deg, var(--lg-red), var(--lg-red-2));
    box-shadow: 0 8px 20px -10px rgba(229,62,62,.8);
    transition: transform .14s, box-shadow .14s, opacity .14s;
}

.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(200,35,51,.85); }
.login-btn:active { transform: translateY(0); }
.login-btn[disabled] { opacity: .6; cursor: default; transform: none; }

.switch-form {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--lg-line);
    font-size: 13.5px;
    color: var(--lg-ink-2);
}

.switch-form a {
    color: var(--lg-red);
    text-decoration: none;
    font-weight: 650;
}

.switch-form a:hover { text-decoration: underline; }

/* ---------------- OTP boxes ---------------- */

/* Carries its own bottom margin because the plain group it replaces -
   which normally supplies that spacing - is hidden in boxes mode. */
.lg-otp {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.lg-otp input {
    width: 100%;
    height: 54px;
    padding: 0;
    text-align: center;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    color: var(--lg-ink);
    background: var(--lg-field);
    border: 1px solid var(--lg-line);
    border-radius: 8px;
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
    -moz-appearance: textfield;
}

.lg-otp input::-webkit-outer-spin-button,
.lg-otp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.lg-otp input:focus {
    border-color: var(--lg-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(229,62,62,.12);
}

.lg-otp input.is-filled { border-color: #c3cad6; background: #fff; }

/* The single field the six boxes write into, and the fallback the page
   falls back to when scripting is off - see the view's comment. */
.lg-otp-plain { margin-bottom: 20px; }

.lg-sent {
    font-size: 13px;
    color: var(--lg-ink-2);
    margin-bottom: 20px;
    padding: 11px 13px;
    border-radius: 8px;
    background: #f4f6f9;
    border: 1px solid var(--lg-line);
    word-break: break-word;
}

.lg-sent b { color: var(--lg-ink); }

/* ---------------- terms checkbox ---------------- */

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
}

.checkbox-group input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--lg-red);
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--lg-ink-2);
    cursor: pointer;
}

.checkbox-group label a { color: var(--lg-red); font-weight: 650; }

/* ---------------- messages ---------------- */

.alert {
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-danger { background: #fdf2f2; border-color: #f3c9c9; color: #a32a2a; }
.alert-success { background: #f1faf4; border-color: #bfe6cd; color: #166b3c; }

.text-danger {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--lg-red);
}

.text-danger:empty { display: none; }

/* ---------------- trust strip ---------------- */

.lg-trust {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 11.5px;
    color: var(--lg-ink-3);
}

.lg-trust span { display: inline-flex; align-items: center; gap: 5px; }
.lg-trust i { color: var(--lg-green); font-style: normal; font-weight: 700; }

/* ---------------- state ---------------- */

.hidden { display: none !important; }

/* ---------------- responsive ---------------- */

@media (max-width: 940px) {
    body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

    /* The panel becomes a short header: the logo and the headline stay,
       the selling points go, so the form is not pushed off the screen. */
    .lg-brand {
        padding: 26px 24px;
        flex-direction: row;
        align-items: center;
        gap: 18px;
    }

    .lg-logo { flex: 0 0 auto; }
    .lg-logo img { height: 62px; }

    .lg-pitch { max-width: none; min-width: 0; }
    .lg-pitch h1 { font-size: 19px; letter-spacing: -.4px; }
    .lg-pitch p, .lg-points, .lg-brand-foot { display: none; }

    .lg-pane { padding: 34px 22px 46px; align-items: start; }
}

@media (max-width: 420px) {
    .lg-brand { padding: 20px 18px; }
    .lg-logo img { height: 52px; }
    .lg-pitch h1 { font-size: 16.5px; }
    .lg-otp { gap: 6px; }
    .lg-otp input { height: 48px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
