/* ====================================================================================
   Auth Glassmorphism - shared visual language for every pre-login/gateway page
   (Login, LoginWhitPhone, Register, ResetPassword, ConfirmEmail, ConfirmMobile,
   AccessDenied). Each page sets --brand-primary/--brand-primary-dark itself (read from
   BrandSettings:PrimaryColor) before this file is loaded; everything here just consumes
   those variables, so the whole family reflects a brand change with zero code edits.
   ==================================================================================== */

body.auth-glass-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--brand-primary) 35%, transparent) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--brand-primary-dark) 35%, transparent) 0%, transparent 45%),
        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Soft floating orbs behind the card - purely decorative, ignored by assistive tech. */
body.auth-glass-body::before,
body.auth-glass-body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
}

body.auth-glass-body::before {
    width: 320px;
    height: 320px;
    top: -80px;
    inset-inline-start: -80px;
    animation: authGlassFloat 14s ease-in-out infinite;
}

body.auth-glass-body::after {
    width: 260px;
    height: 260px;
    bottom: -60px;
    inset-inline-end: -60px;
    animation: authGlassFloat 18s ease-in-out infinite reverse;
}

@keyframes authGlassFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -25px); }
}

.auth-glass-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-glass-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    padding: 0.5rem;
    animation: authGlassCardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authGlassCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-glass-card {
        animation: none;
    }
}

.auth-glass-card .card-body {
    padding: 1.5rem 1.75rem 1.75rem;
}

.auth-glass-logo {
    display: block;
    margin: 0.5rem auto 0.75rem;
    width: 88px;
    height: auto;
}

.auth-glass-title {
    text-align: center;
    font-weight: 700;
    color: #2b2f38;
    margin-bottom: 0;
}

.auth-glass-card hr {
    border-color: rgba(0, 0, 0, 0.08);
    margin: 0;
}

.auth-glass-card .form-control {
    background: rgba(255, 255, 255, 0.7);
}

.auth-glass-card .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border: none;
    font-weight: 600;
    box-shadow: 0 10px 25px -8px color-mix(in srgb, var(--brand-primary) 60%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-glass-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--brand-primary) 70%, transparent);
}

.auth-glass-links {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
}

.auth-glass-links a {
    text-decoration: none;
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.auth-glass-links a:hover {
    text-decoration: underline;
}

.auth-glass-field-icon {
    color: var(--brand-primary);
    font-size: 0.85em;
    margin-inline-end: 0.35rem;
    opacity: 0.85;
}

.auth-glass-captcha {
    align-items: stretch;
}

.auth-glass-captcha-img {
    height: 46px;
    width: 150px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.auth-glass-captcha-refresh {
    height: 46px;
    flex-shrink: 0;
}

.auth-glass-captcha input {
    height: 46px;
    text-align: center;
    letter-spacing: 0.3em;
    font-weight: 700;
}

/* FontAwesome's directional icons (arrow pointing into a bracket, drawn for LTR "entering"
   motion) are never auto-mirrored for RTL pages. Left as-is on this rtl-only page family the
   login button's icon pointed away from the "ورود" label instead of into it - visually read as
   "sign out" rather than "sign in". Flipping it horizontally is a plain CSS rule, so it isn't
   affected by FontAwesome's <i> -> <svg> replacement the way a JS className mutation would be. */
[dir="rtl"] .auth-glass-card .fa-sign-in-alt {
    display: inline-block;
    transform: scaleX(-1);
}

/* Respect the user's reduced-motion preference - decorative orbs stop moving. */
@media (prefers-reduced-motion: reduce) {
    body.auth-glass-body::before,
    body.auth-glass-body::after {
        animation: none;
    }
}

@media (max-width: 480px) {
    .auth-glass-card .card-body {
        padding: 1.25rem 1.1rem 1.5rem;
    }
}
