:root {
    --auth-blue: #1565d8;
    --auth-blue-hover: #1254b8;
    --auth-orange: #f97316;
    --auth-navy: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-card-radius: 1.25rem;
    --auth-input-radius: 0.75rem;
}

body.app-blank {
    background: #eef2f7;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(26rem, 42rem) 1fr;
    grid-template-rows: 1fr;
    direction: ltr;
}

.auth-page__bg {
    position: absolute;
    inset: 0;
    background-color: #dbeafe;
    background-image: url('../media/auth/login-hero.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 0;
}

.auth-page__lang {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    left: auto;
    z-index: 5;
}

.auth-lang-switch .btn {
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.88);
    color: var(--auth-navy);
}

.auth-lang-switch .btn.active {
    background: var(--auth-blue);
    border-color: var(--auth-blue);
    color: #fff;
}

.auth-page__card-wrap {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7rem clamp(1.25rem, 4vw, 3rem) 2rem clamp(3.5rem, 12vw, 8.5rem);
}

html[dir='rtl'] .auth-card {
    direction: rtl;
}

.auth-card {
    width: min(100%, 31rem);
    margin-left: 20px;
    margin-right: 0;
    background: #fff;
    border-radius: var(--auth-card-radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    padding: 3rem 2.75rem 2rem;
}

.auth-card__title {
    color: var(--auth-navy);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.65rem;
    line-height: 1.2;
}

.auth-card__subtitle {
    color: var(--auth-muted);
    font-size: 1rem;
    text-align: center;
    margin: 0 0 2rem;
}

.auth-card__alert {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.auth-card__alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-card__alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap__icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 1rem;
    transform: translateY(-50%);
    color: #94a3b8;
    display: inline-flex;
    pointer-events: none;
}

.auth-input-wrap__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.auth-input {
    width: 100%;
    height: 3.5rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-input-radius);
    padding-inline: 2.85rem 1rem;
    font-size: 1rem;
    color: var(--auth-navy);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.12);
}

.auth-input.is-invalid {
    border-color: #ef4444;
}

.auth-input-wrap--password .auth-input {
    padding-inline-end: 2.75rem;
}

.auth-input-wrap__toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.85rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0.25rem;
    display: inline-flex;
    cursor: pointer;
}

.auth-input-wrap__toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.auth-input-wrap__toggle:hover {
    color: var(--auth-blue);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.35rem 0 1.5rem;
    flex-wrap: wrap;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-blue);
}

.auth-forgot {
    color: var(--auth-blue);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot:hover {
    color: var(--auth-blue-hover);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    height: 3.5rem;
    border: 0;
    border-radius: var(--auth-input-radius);
    background: var(--auth-blue);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover {
    background: var(--auth-blue-hover);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-card__footer {
    margin-top: 1.75rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
}

.auth-field-error {
    margin-top: 0.35rem;
    color: #dc2626;
    font-size: 0.8125rem;
}

@media (max-width: 991.98px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-page__bg {
        background-position: 50% 0;
    }

    .auth-page__card-wrap {
        justify-content: flex-start;
        padding: 6.5rem 1rem 1.5rem clamp(1.25rem, 6vw, 2rem);
    }

    .auth-card {
        margin-left: 0;
    }

    .auth-page__lang {
        right: 1rem;
        left: auto;
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 2rem 1.35rem 1.5rem;
    }

    .auth-card__title {
        font-size: 1.5rem;
    }
}
