/* Login surface: a calm, touch-first entry point that shares the Redesign palette. */
.redesign-auth {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 5vw, 64px);
    background: var(--bs-body-bg);
}

.login-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(360px, .78fr);
    direction: ltr;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 28px;
    background: var(--rd-surface);
    box-shadow: 0 24px 70px rgb(35 32 78 / 10%);
}

.login-welcome,
.login-panel { direction: rtl; }

.login-welcome {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 590px;
    padding: clamp(28px, 5vw, 58px);
    color: #fff;
    background: #4d49ba;
    isolation: isolate;
}

.login-welcome::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    inset-inline-start: -120px;
    inset-block-end: -125px;
    border: 1px solid rgb(255 255 255 / 24%);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgb(255 255 255 / 5%), 0 0 0 56px rgb(255 255 255 / 4%);
    z-index: -1;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.login-brand:hover { color: inherit; }

.login-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 14px;
    background: rgb(255 255 255 / 12%);
}

.login-brand-mark { color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.login-brand strong,
.login-brand small { display: block; }
.login-brand strong { font-size: 1.08rem; letter-spacing: -.02em; }
.login-brand small { margin-top: 2px; color: rgb(255 255 255 / 72%); font-size: .72rem; }

.login-welcome-copy { max-width: 410px; margin-block: auto; padding-block: 48px; }
.login-kicker { margin: 0 0 10px; color: var(--bs-link-color); font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.login-welcome .login-kicker { color: rgb(255 255 255 / 72%); }
.login-welcome h1 { max-width: none; margin: 0; color: #fff; font-size: clamp(2.1rem, 4.1vw, 3.6rem); line-height: 1.25; letter-spacing: -.055em; white-space: nowrap; }
.login-welcome-copy > p:last-child { max-width: 32ch; margin: 22px 0 0; color: rgb(255 255 255 / 78%); font-size: 1rem; line-height: 2; }

.login-trust-list { display: grid; gap: 12px; color: rgb(255 255 255 / 82%); font-size: .78rem; }
.login-trust-list span { display: flex; align-items: center; gap: 9px; }
.login-trust-bullet { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid #d7d5ff; border-radius: 50%; }

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(28px, 5vw, 58px);
    background: var(--rd-surface);
}

.login-panel-header { margin-bottom: 30px; }
.login-panel-header h2 { margin: 0; color: var(--bs-heading-color); font-size: clamp(1.65rem, 3vw, 2.15rem); letter-spacing: -.04em; }
.login-panel-header > p:last-child { margin: 10px 0 0; color: var(--rd-muted); font-size: .84rem; }

.login-field { margin-bottom: 20px; }
.login-field .form-label { display: block; margin-bottom: 8px; color: var(--bs-heading-color); }
.login-inline-error { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--rd-btn-danger); font-size: .72rem; line-height: 1.6; }
.login-inline-error::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.login-input-wrap .form-control[aria-invalid="true"] { border-color: color-mix(in srgb, var(--rd-btn-danger) 72%, var(--bs-border-color)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rd-btn-danger) 13%, transparent); }
/* Keep validation from browser helpers or local adapters in the same inline position. */
.login-input-wrap { flex-wrap: wrap; }
.login-input-wrap > [id$="-error"],
.login-input-wrap > .invalid-feedback,
.login-input-wrap > .field-error { position: static !important; display: block !important; width: 100%; margin: 7px 0 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; color: var(--rd-btn-danger) !important; background: transparent !important; font-size: .72rem !important; line-height: 1.6; transform: none !important; box-shadow: none !important; }
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap .form-control { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--bs-border-color); border-radius: 12px; background: var(--bs-body-bg); direction: ltr; text-align: left; }
.login-input-wrap .form-control:focus { border-color: #817de0; box-shadow: 0 0 0 4px rgb(89 85 209 / 13%); }
.login-input-icon { position: absolute; inset-inline-start: 14px; z-index: 2; width: 18px; height: 18px; color: var(--rd-muted); pointer-events: none; }
.login-password-wrap .form-control { padding-inline-start: 54px; padding-inline-end: 14px; }
.login-password-toggle { position: absolute; inset-inline-start: 6px; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 9px; color: var(--rd-muted); background: transparent; transform: translateY(-50%); }
.login-password-toggle:hover,
.login-password-toggle:focus-visible { color: var(--bs-link-color); background: var(--rd-active); }
.login-password-toggle:focus-visible { outline: 3px solid rgb(89 85 209 / 24%); outline-offset: 1px; }
.login-password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 24px; }
.login-remember { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--bs-body-color); font-size: .8rem; cursor: pointer; }
.login-remember .form-check-input { width: 18px; height: 18px; margin: 0; accent-color: var(--bs-primary); }
.login-help { color: var(--rd-muted); font-size: .72rem; text-align: end; }

.login-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 13px 18px; border: 1px solid #5955d1; border-radius: 12px; color: #fff; background: #5955d1; font: inherit; font-size: .9rem; font-weight: 700; transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.login-submit:hover { border-color: #4843b2; background: #4843b2; box-shadow: 0 8px 20px rgb(89 85 209 / 24%); transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }
.login-submit:focus-visible { outline: 3px solid rgb(89 85 209 / 28%); outline-offset: 3px; }

.login-security-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--bs-border-color); color: var(--rd-muted); font-size: .72rem; line-height: 1.9; }
.login-security-note .login-trust-bullet { flex: 0 0 auto; margin-top: 7px; border-color: var(--rd-btn-success); }
.login-panel .alert { margin-bottom: 20px; }

@media (max-width: 820px) {
    .redesign-auth { padding: 16px; align-items: start; }
    .login-shell { grid-template-columns: 1fr; max-width: 560px; border-radius: 22px; }
    .login-welcome { min-height: auto; padding: 24px; }
    .login-welcome-copy { padding-block: 38px 30px; }
    .login-welcome h1 { max-width: none; font-size: clamp(2rem, 8vw, 3rem); white-space: normal; }
    .login-welcome-copy > p:last-child { margin-top: 12px; font-size: .88rem; }
    .login-trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: .7rem; }
    .login-panel { padding: 28px 24px 24px; }
}

@media (max-width: 420px) {
    .redesign-auth { padding: 0; }
    .login-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
    .login-welcome { padding: 22px 20px 24px; }
    .login-welcome-copy { padding-block: 34px 26px; }
    .login-trust-list { grid-template-columns: 1fr; }
    .login-panel { padding: 28px 20px max(24px, env(safe-area-inset-bottom)); }
    .login-options { align-items: flex-start; flex-direction: column; gap: 4px; }
    .login-help { text-align: start; }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit { transition: none; }
}
