/*
 * AMG ERP — Split-screen login redesign (approved).
 * Self-contained: does NOT depend on style.css / style-rtl.css. RTL is handled
 * with CSS logical properties, so a single file serves LTR and RTL.
 * Brand colours live in CSS variables (theme-4 palette).
 */
:root {
    --navy: #145388;
    --navy-2: #0D3A61;
    --navy-3: #1E6CB0;
    --accent: #1E6CB0;
    --ink: #1c2733;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f0f4f3;
    --danger: #c0392b;
    --ok: #1e8e5a;
    --radius: 12px;
}

.auth-login *,
.auth-login *::before,
.auth-login *::after {
    box-sizing: border-box;
}

html,
body.auth-login {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.auth-login {
    font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.auth-login .wrap {
    display: flex;
    min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.auth-login .brand {
    flex: 1.05;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--navy-2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
}

/* Silk-mesh background (approved): deep navy base + soft blue glows */
.auth-login .brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 90% at 85% 10%, rgba(30, 108, 176, .75), transparent 65%),
        radial-gradient(90% 80% at 0% 100%, rgba(9, 38, 64, .9), transparent 60%),
        radial-gradient(50% 60% at 70% 80%, rgba(46, 134, 193, .28), transparent 70%);
}

/* Top sheen */
.auth-login .brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(255, 255, 255, .05) 0%, transparent 35%);
}

.auth-login .brand-logo {
    position: relative;
    z-index: 2;
    width: 200px;
    max-width: 100%;
    height: auto;
}

.auth-login .brand-mid {
    position: relative;
    z-index: 2;
    max-width: 440px;
}

.auth-login .brand-mid h1 {
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .2px;
    margin: 0;
}

.auth-login .brand-mid p {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .75);
}

.auth-login .points {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-login .point {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14.5px;
    color: rgba(255, 255, 255, .88);
}

.auth-login .point svg {
    flex: none;
    margin-top: 2px;
}

.auth-login .brand-foot {
    position: relative;
    z-index: 2;
    font-size: 13px;
    color: rgba(255, 255, 255, .55);
}

/* ---------- Form panel ---------- */
.auth-login .panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(141.55deg, rgba(240, 244, 243, 0) 3.46%, #f0f4f3 99.86%), #fff;
}

.auth-login .panel-top {
    display: flex;
    justify-content: flex-end;
    padding: 22px 40px 0;
}

.auth-login .lang {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    font-size: 13px;
    background: #fff;
}

.auth-login .lang a {
    border: 0;
    background: #fff;
    padding: 7px 16px;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    line-height: 1.4;
}

.auth-login .lang a.active {
    background: var(--navy);
    color: #fff;
}

.auth-login .panel-mid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
}

.auth-login .form-box {
    width: 100%;
    max-width: 400px;
}

.auth-login .logo-sm {
    display: none;
    width: 170px;
    height: auto;
    margin: 0 auto 26px;
}

.auth-login h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
}

.auth-login .sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14.5px;
}

.auth-login form {
    margin-top: 30px;
}

.auth-login .field {
    margin-bottom: 18px;
}

.auth-login label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #334155;
}

.auth-login .control {
    position: relative;
}

.auth-login .control > .lead {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
}

.auth-login input[type=email],
.auth-login input[type=password],
.auth-login input[type=text] {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding-block: 0;
    padding-inline: 44px;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-login input::placeholder {
    color: #a6b2c1;
}

.auth-login input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(20, 83, 136, .13);
}

.auth-login .field.error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(192, 57, 43, .09);
}

.auth-login .err {
    display: none;
    margin-top: 7px;
    font-size: 13px;
    color: var(--danger);
    align-items: center;
    gap: 6px;
}

.auth-login .field.error .err {
    display: flex;
}

.auth-login .err svg {
    flex: none;
}

.auth-login .eye {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    cursor: pointer;
    padding: 8px;
    color: #94a3b8;
    display: flex;
    border-radius: 8px;
}

.auth-login .eye:hover {
    color: var(--navy);
}

.auth-login .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 22px;
}

.auth-login .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 400;
}

.auth-login .remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--navy);
}

.auth-login .row a {
    font-size: 14px;
    color: var(--navy-3);
    text-decoration: none;
    font-weight: 600;
}

.auth-login .row a:hover {
    text-decoration: underline;
}

/* reCAPTCHA v2 widget sits between the fields and the button */
.auth-login .captcha {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-login .btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--navy);
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .15s, transform .05s;
}

.auth-login .btn:hover {
    background: var(--navy-2);
}

.auth-login .btn:active {
    transform: scale(.99);
}

.auth-login .btn[disabled] {
    background: #5c7ea0;
    cursor: default;
}

.auth-login .spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-login-spin .7s linear infinite;
    display: none;
}

.auth-login .btn.loading .spinner {
    display: block;
}

@keyframes auth-login-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-login .alert {
    display: none;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    background: #fdf0ee;
    border: 1px solid #f2c7c0;
    color: #8f2c20;
    line-height: 1.45;
}

.auth-login .alert.show {
    display: block;
}

.auth-login .panel-foot {
    padding: 0 40px 22px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #9aa7b5;
    font-size: 12px;
}

/* ---------- Select Membership ---------- */
/* Wider form box so the membership list breathes; still capped for readability. */
.auth-login .form-box.form-box-wide {
    max-width: 460px;
}

.auth-login .membership-list {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-login .membership-form {
    margin: 0;
}

/* A whole card is one clickable target (2026 pattern): avatar + info + arrow,
   all on one row. Selectable cards are the submit <button> itself. */
.auth-login .membership {
    width: 100%;
    text-align: start;
    font: inherit;
    color: inherit;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .15s, box-shadow .15s, transform .05s;
}

button.membership {
    cursor: pointer;
}

.auth-login .membership.is-selectable:hover {
    border-color: var(--navy);
    box-shadow: 0 6px 18px rgba(20, 83, 136, .12);
}

.auth-login .membership.is-selectable:hover .membership-arrow {
    background: var(--navy);
    color: #fff;
    transform: translateX(2px);
}

.auth-login .membership.is-selectable:active {
    transform: scale(.995);
}

.auth-login .membership.is-disabled {
    background: #f8fafc;
    border-style: dashed;
    opacity: .85;
}

/* Monogram avatar */
.auth-login .membership-avatar {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    background: linear-gradient(145deg, var(--navy-3), var(--navy-2));
    text-transform: uppercase;
}

.auth-login .membership.is-disabled .membership-avatar {
    background: #cbd5e1;
    color: #fff;
}

.auth-login .membership-info {
    flex: 1;
    min-width: 0;
}

.auth-login .membership-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
}

.auth-login .membership-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    word-break: break-word;
}

.auth-login .membership-note {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0;
}

.auth-login .membership-note.is-error {
    color: var(--danger);
}

/* Badges — self-contained (auth-login.css loads no Bootstrap). */
.auth-login .badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.auth-login .badge-success {
    background: #e3f5ec;
    color: #1e8e5a;
}

.auth-login .badge-info {
    background: #e4f0fb;
    color: #1e6cb0;
}

.auth-login .badge-warning {
    background: #fdf3e0;
    color: #b7791f;
}

.auth-login .badge-danger {
    background: #fdecea;
    color: #c0392b;
}

.auth-login .badge-secondary {
    background: #eef1f5;
    color: #64748b;
}

/* Round arrow action, inline on the far side of the row */
.auth-login .membership-arrow {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    background: #eef4f9;
    transition: background .15s, color .15s, transform .15s;
}

.auth-login .membership-arrow svg {
    display: block;
}

[dir="rtl"] .auth-login .membership-arrow svg {
    transform: scaleX(-1);
}

.auth-login .membership-lock {
    flex: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.auth-login .membership-empty {
    margin-top: 26px;
    text-align: center;
}

.auth-login .membership-empty p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 8px 0 22px;
}

.auth-login .membership-foot {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-login .membership-count {
    font-size: 13px;
    color: var(--muted);
}

.auth-login .logout-link {
    border: 0;
    background: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-3);
    cursor: pointer;
    text-decoration: none;
}

.auth-login .logout-link:hover {
    text-decoration: underline;
}

/* A visible flash on Select Membership (login only shows session('status')). */
.auth-login .alert.alert-inline {
    display: block;
}

.auth-login .alert.alert-inline.alert-success {
    background: #e9f7f0;
    border-color: #b8e3cd;
    color: #1e6f4c;
}

@media (max-width: 920px) {
    .auth-login .brand {
        display: none;
    }

    .auth-login .logo-sm {
        display: block;
    }

    .auth-login .panel-top {
        padding: 18px 22px 0;
    }

    .auth-login .panel-mid {
        padding: 24px 22px;
    }

    .auth-login .panel-foot {
        padding: 0 22px 18px;
    }

    .auth-login .membership-avatar {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
}
