/* ==========================================================================
   Bilnov Gallery - Administrative Authentication Portal Styles
   Consistent with frontend/static/css/index.css variables
   Complete LTR and RTL support
   ========================================================================== */

:root {
    --auth-bg-gradient: radial-gradient(circle at 50% 10%, rgba(13, 110, 253, 0.08) 0%, rgba(248, 249, 250, 1) 70%);
    --auth-card-bg: #ffffff;
    --auth-card-border: rgba(226, 232, 240, 0.9);
    --auth-card-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(0, 0, 0, 0.03);
    --auth-input-bg: #f8fafc;
    --auth-input-border: #cbd5e1;
    --auth-input-focus-border: var(--brand-primary, #0d6efd);
    --auth-text-muted: #64748b;
}

/* Base Viewport Canvas */
.auth-viewport-wrapper {
    background: var(--auth-bg-gradient);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Ambient Visual Effects */
.auth-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
}

.glow-orb-1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.25) 0%, rgba(13, 110, 253, 0) 70%);
    top: -150px;
    inset-inline-start: -100px;
}

.glow-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
    bottom: -120px;
    inset-inline-end: -80px;
}

.auth-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 1;
}

/* Card Container */
.auth-card-container {
    max-width: 440px;
    width: 100%;
}

/* Top Bar: Security indicator & Language Switcher */
.auth-top-bar {
    z-index: 3;
}

.live-security-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--brand-success, #198754);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
    animation: auth-pulse 2s infinite ease-in-out;
}

@keyframes auth-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.65;
    }
}

.security-status-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    letter-spacing: 0.02em;
}

.auth-lang-wrapper .language-dropdown .lang-toggle {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--brand-dark, #212529);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.auth-lang-wrapper .language-dropdown .lang-toggle:hover {
    border-color: var(--brand-primary, #0d6efd);
    color: var(--brand-primary, #0d6efd);
}

/* Main Card */
.auth-main-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border) !important;
    border-radius: 24px !important;
    box-shadow: var(--auth-card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-accent-gradient {
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary, #0d6efd), #6366f1);
    width: 100%;
}

/* Brand Header */
.brand-shield-badge {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
    border: 1px solid rgba(13, 110, 253, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-shield-badge:hover {
    transform: scale(1.06) rotate(3deg);
}

.brand-shield-icon {
    font-size: 1.85rem;
    color: var(--brand-primary, #0d6efd);
}

.auth-brand-title {
    font-weight: 800;
    color: var(--brand-dark, #212529);
    letter-spacing: -0.01em;
}

.auth-role-badge {
    background: rgba(13, 110, 253, 0.09);
    color: var(--brand-primary, #0d6efd);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 30px;
}

.auth-subtitle {
    font-size: 0.87rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

/* Form Styles */
.auth-form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-dark, #212529);
    margin-bottom: 6px;
}

/* Input Containers & Icon Positioning */
.form-input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-prefix-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 3;
    transition: color 0.2s ease;
}

/* Default Auth Input */
.auth-input {
    width: 100%;
    height: 50px;
    background-color: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--brand-dark, #212529);
    transition: all 0.2s ease-in-out;
}

.auth-input:focus {
    background-color: #ffffff;
    border-color: var(--auth-input-focus-border);
    box-shadow: 0 0 0 3.5px rgba(13, 110, 253, 0.15);
    outline: none;
}

.form-input-box:focus-within .input-prefix-icon {
    color: var(--brand-primary, #0d6efd);
}

/* ==========================================================================
   STRICT INTERNAL PASSWORD TOGGLE BUTTON STYLING
   ========================================================================== */
.password-input-box {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    z-index: 4;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.password-toggle-btn:hover {
    color: var(--brand-primary, #0d6efd);
    background-color: rgba(13, 110, 253, 0.08);
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: none;
    color: var(--brand-primary, #0d6efd);
}

.password-toggle-btn.active {
    color: var(--brand-primary, #0d6efd);
}

.toggle-eye-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.password-toggle-btn:hover .toggle-eye-icon {
    transform: scale(1.1);
}

/* ==========================================================================
   RTL / LTR Bi-directional Rules
   ========================================================================== */

/* RTL (Arabic) Rules */
[dir="rtl"] .auth-viewport-wrapper,
[dir="rtl"] .auth-card-container {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .input-prefix-icon {
    right: 16px;
    left: auto;
}

[dir="rtl"] .auth-input {
    padding-right: 46px;
    padding-left: 16px;
    text-align: right;
}

[dir="rtl"] .auth-password-input {
    /* Right side for prefix icon, Left side strictly reserved for password toggle */
    padding-right: 46px;
    padding-left: 48px;
}

[dir="rtl"] .password-toggle-btn {
    left: 8px;
    right: auto;
}

[dir="rtl"] .arrow-direction {
    transform: rotate(0deg);
}

/* LTR (English / French) Rules */
[dir="ltr"] .auth-viewport-wrapper,
[dir="ltr"] .auth-card-container {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .input-prefix-icon {
    left: 16px;
    right: auto;
}

[dir="ltr"] .auth-input {
    padding-left: 46px;
    padding-right: 16px;
    text-align: left;
}

[dir="ltr"] .auth-password-input {
    /* Left side for prefix icon, Right side strictly reserved for password toggle */
    padding-left: 46px;
    padding-right: 48px;
}

[dir="ltr"] .password-toggle-btn {
    right: 8px;
    left: auto;
}

[dir="ltr"] .arrow-direction {
    transform: rotate(180deg);
}

/* Submit Button */
.auth-submit-btn {
    background-color: var(--brand-primary, #0d6efd);
    border-color: var(--brand-primary, #0d6efd);
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 0.96rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
    transition: all 0.25s ease;
}

.auth-submit-btn:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.75;
    transform: none;
}

/* Security Assurance Footer */
.auth-security-footer {
    border-color: #f1f5f9 !important;
}

.security-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-text-muted);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .auth-main-card {
        border-radius: 18px !important;
    }
    .auth-main-card .card-body {
        padding: 1.5rem !important;
    }
    .brand-shield-badge {
        width: 54px;
        height: 54px;
    }
    .brand-shield-icon {
        font-size: 1.5rem;
    }
}
