/* ============== Base ============== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--text);
    background: var(--bg);
}

/* Logical spacing helpers */
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.w-100 { width: 100%; }

/* ============== Layout ============== */
.auth {
    min-height: 100vh;
    display: flex;
}

.auth-left {
    position: relative;
    flex: 1 1 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background: #0b2239;
}
@media (min-width: 992px) {
    .auth-left { display: flex; }
}
.auth-left::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.55), rgba(0,0,0,.35));
}
.auth-left::after {
    content: "";
    position: absolute; inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    mix-blend-mode: multiply;
    opacity: .9;
}
.auth-left-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}
.display-title {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.15;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}
.display-title .accent {
    display: block;
    color: var(--primary);
}

.auth-right {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 56px);
    background: var(--bg);
}

/* ============== Card ============== */
.auth-card{
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: clamp(20px, 4vw, 28px) clamp(20px, 4vw, 28px) calc(clamp(20px, 4vw, 28px) + 36px);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

.version-badge{
    position: absolute;
    bottom: 14px;            /* space from the bottom */
    inset-inline-end: 14px;  /* right in LTR, left in RTL */
    top: auto;               /* override any previous 'top' */
    background: #e6f4ff;
    color: #0357b3;
    border: 1px solid #cde8ff;
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 10px;
}

/* already in your file, keep this RTL tweak */
html[dir="rtl"] .version-badge{
    inset-inline-start: 14px;
    inset-inline-end: auto;
}

.auth-head{ margin-bottom: 12px; }
.auth-title{
    margin: 0 0 4px 0;
    font-size: 28px;
    font-weight: 800;
}
.auth-subtitle{
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

/* ============== Form ============== */
.form-label{
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control{
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus{
    outline: none;
    border-color: color-mix(in srgb, var(--primary) 50%, #0000);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, #0000);
}

.password-field{
    position: relative;
}
.password-field .pass-toggle{
    position: absolute;
    top: 0; bottom: 0;
    inset-inline-end: 8px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: .7;
}
.password-field .pass-toggle:hover{ opacity: 1; }

.checkbox{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    font-size: 14px;
    color: var(--muted);
}
.checkbox input{
    width: 16px; height: 16px;
    border-radius: 4px;
    accent-color: var(--primary);
}

.btn-primary{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}
.btn-primary:hover{
    filter: brightness(.96);
    box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 22%, #0000);
}
.btn-primary:active{ transform: translateY(1px); }

/* Alerts */
.alert-simple{
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
}
.alert-simple.success{
    background: #e9f9ee;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-simple.danger{
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-simple ul{ margin: 0; padding-inline-start: 18px; }

/* ============== RTL tweaks ============== */
html[dir="rtl"] .auth{ flex-direction: row-reverse; }
html[dir="rtl"] .version-badge{ inset-inline-start: 14px; inset-inline-end: auto; }
html[dir="rtl"] .alert-simple ul{ padding-inline-start: 0; padding-inline-end: 18px; }
