/* ==========================================================================
   Split-screen auth shell — login, register, forgot & reset password.
   One stylesheet for every auth screen so they cannot drift apart.
   Logical properties throughout so the whole thing mirrors under dir="rtl".
   ========================================================================== */

:root {
    --auth-brand: #6330ad;
    --auth-brand-dark: #50228f;
    --auth-ink: #252c46;
    --auth-muted: #83889a;
    --auth-line: #e4e2eb;
}

.auth-body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background: #fff;
}

/* ------------------------------------------------------------------ topbar */
.auth-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px clamp(16px, 4vw, 40px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--auth-line);
    backdrop-filter: blur(8px);
}

.auth-topbar__brand img {
    /* The stored logo is square (1500x1500), so size by height and let the
       width follow rather than reserving a wide box it cannot fill. */
    width: auto;
    max-width: 180px;
    height: 46px;
    object-fit: contain;
}

.auth-topbar__right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-topbar__home,
.auth-topbar__lang {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    /* 44px keeps these comfortably tappable on phones */
    min-height: 44px;
    padding: 0 16px;
    font-size: .86rem;
    font-weight: 600;
    color: #55506b;
    text-decoration: none;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.auth-topbar__home:hover,
.auth-topbar__lang:hover {
    color: var(--auth-brand);
    background: #f6f2fd;
    border-color: #d9cdf2;
}

[dir="rtl"] .auth-topbar__home .bi-arrow-left {
    transform: scaleX(-1);
}

/* ------------------------------------------------------------------- shell */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 69px);
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 1.02fr 1fr;
    }
}

/* -------------------------------------------------------------- brand side */
.auth-aside {
    position: relative;
    display: none;
    padding: clamp(38px, 5vw, 72px);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #1b1240 0%, #2c1a5e 45%, #4a1f96 100%);
}

@media (min-width: 992px) {
    .auth-aside {
        display: flex;
        align-items: center;
    }
}

.auth-aside__inner {
    position: relative;
    z-index: 2;
    max-width: 520px;
}

.auth-aside__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 15px;
    margin-bottom: 22px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
}

.auth-aside__title {
    margin: 0 0 16px;
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.9rem, 2.6vw, 2.7rem);
    font-weight: 700;
    line-height: 1.2;
}

.auth-aside__title span,
.auth-aside__title strong {
    color: #b48cff;
}

.auth-aside__text {
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, .76);
}

.auth-aside__text p:last-child {
    margin-bottom: 0;
}

.auth-aside__list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.auth-aside__list li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    font-size: .95rem;
    color: rgba(255, 255, 255, .9);
}

.auth-aside__list i {
    flex: 0 0 auto;
    font-size: 1.1rem;
    color: #34d399;
}

.auth-aside__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
}

.auth-aside__glow--one {
    width: 420px;
    height: 420px;
    background: rgba(124, 58, 237, .5);
    top: -130px;
    inset-inline-end: -110px;
}

.auth-aside__glow--two {
    width: 340px;
    height: 340px;
    background: rgba(30, 99, 240, .3);
    bottom: -140px;
    inset-inline-start: -90px;
}

/* --------------------------------------------------------------- form side */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 60px) clamp(18px, 5vw, 56px);
    background: linear-gradient(120deg, #fffdf8, #f7f5fc 55%, #f3f8ff);
}

@media (min-width: 992px) {
    .auth-panel {
        background: #fff;
    }
}

.auth-panel__inner {
    width: min(100%, 460px);
}

.auth-head {
    margin-bottom: 26px;
    text-align: center;
}

.auth-head__icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    font-size: 1.45rem;
    color: #fff;
    background: linear-gradient(135deg, #56209f, #8654d9);
    border-radius: 18px;
    place-items: center;
}

.auth-head__eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7540c9;
}

.auth-head__title {
    margin: 6px 0;
    font-family: "Poppins", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--auth-ink);
}

.auth-head__subtitle {
    margin: 0;
    font-size: .86rem;
    color: var(--auth-muted);
}

/* ------------------------------------------------------------------ fields */
.auth-panel label,
.auth-panel .form-label {
    display: block;
    margin-bottom: 7px;
    font-size: .78rem;
    font-weight: 700;
    color: #444a60;
}

.auth-panel .form-control,
.auth-panel .form-select {
    min-height: 50px;
    border: 1px solid #dcdee7;
    border-radius: 12px;
}

.auth-panel .form-control:focus,
.auth-panel .form-select:focus {
    border-color: #7540c9;
    box-shadow: 0 0 0 4px rgba(117, 64, 201, .09);
}

/* Input with a leading icon (and optionally a trailing button). */
.login-input {
    position: relative;
}

.login-input > i {
    position: absolute;
    top: 50%;
    z-index: 2;
    inset-inline-start: 15px;
    color: #8d92a4;
    transform: translateY(-50%);
}

.login-input .form-control {
    padding-inline-start: 43px;
    padding-inline-end: 43px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    z-index: 2;
    inset-inline-end: 8px;
    padding: 7px;
    color: #8a8fa1;
    background: transparent;
    border: 0;
    transform: translateY(-50%);
}

.login-error,
.auth-panel .invalid-feedback {
    display: block;
    margin-top: 5px;
    font-size: .72rem;
    color: #c83d4b;
}

.login-options {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0;
    font-size: .75rem;
}

.login-options label {
    display: flex !important;
    gap: 7px;
    align-items: center;
    margin: 0 !important;
    font-weight: 500 !important;
    color: #656b80 !important;
}

.login-options a,
.auth-foot a,
.password-flow-back {
    font-weight: 700;
    color: var(--auth-brand);
    text-decoration: none;
}

.login-options a:hover,
.auth-foot a:hover {
    text-decoration: underline;
}

.login-submit,
.auth-submit {
    display: flex;
    width: 100%;
    min-height: 50px;
    gap: 9px;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: var(--auth-brand);
    border: 0;
    border-radius: 12px;
    transition: background-color .18s ease;
}

.login-submit:hover,
.auth-submit:hover {
    color: #fff;
    background: var(--auth-brand-dark);
}

.login-submit:disabled,
.auth-submit:disabled {
    opacity: .7;
}

[dir="rtl"] .login-submit i,
[dir="rtl"] .auth-submit i {
    transform: scaleX(-1);
}

.auth-foot {
    padding-top: 19px;
    margin-top: 22px;
    text-align: center;
    border-top: 1px solid #ececf1;
}

.auth-foot p,
.auth-foot span {
    display: block;
    margin: 0 0 7px;
    font-size: .78rem;
    color: #7f8497;
}

.password-flow-back {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    margin-top: 18px;
    font-size: .8rem;
}

[dir="rtl"] .password-flow-back .bi-arrow-left {
    transform: scaleX(-1);
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 575.98px) {
    .auth-topbar {
        padding: 12px 16px;
    }

    .auth-topbar__home span,
    .auth-topbar__lang span {
        display: none;
    }

    .auth-topbar__home,
    .auth-topbar__lang {
        padding: 0 14px;
    }

    .auth-head__title {
        font-size: 1.35rem;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ------------------------------------------- password recovery flow bits */
.password-flow-form button[type="submit"] {
    display: flex;
    width: 100%;
    min-height: 50px;
    gap: 9px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    font-weight: 700;
    color: #fff;
    background: var(--auth-brand);
    border: 0;
    border-radius: 12px;
    transition: background-color .18s ease;
}

.password-flow-form button[type="submit"]:hover {
    background: var(--auth-brand-dark);
}

[dir="rtl"] .password-flow-form button[type="submit"] i {
    transform: scaleX(-1);
}

.password-flow-input {
    position: relative;
}

.password-flow-input > i {
    position: absolute;
    top: 50%;
    z-index: 2;
    inset-inline-start: 15px;
    color: #8d92a4;
    transform: translateY(-50%);
}

.password-flow-input .form-control {
    padding-inline-start: 43px;
}

.password-flow-error {
    display: block;
    margin-top: 5px;
    font-size: .72rem;
    color: #c83d4b;
}

.password-flow-destination {
    display: block;
    margin-bottom: 20px;
    font-size: .9rem;
    color: var(--auth-brand);
    word-break: break-all;
}

.password-flow-resend {
    margin-top: 18px;
    font-size: .78rem;
    color: var(--auth-muted);
}

.password-flow-resend a {
    font-weight: 700;
    color: var(--auth-brand);
    text-decoration: none;
}

.code-input {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .5em;
    text-align: center;
}

/* Admin panel gets a cooler slate gradient to distinguish it from the public site. */
.auth-aside--admin {
    background: linear-gradient(135deg, #101828 0%, #1f2544 45%, #3a2a6d 100%);
}
