/* TrustNex — authentication pages (login, 2FA, reset). Extracted from
   login.ejs inline <style>. Directional rules use CSS logical properties
   (inset-inline-*, padding-inline-*, text-align: start/end) so they flip
   automatically under dir="rtl" — no server-side conditionals needed. */

:root {
    --primary: #0C90AF;
    --primary-dark: #0C3341;
    --primary-light: #35D7F4;
    --dark-bg: #0A1E2B;
    --panel-bg: #EDF3F8;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-dark: #102235;
    --text-muted: #5E7288;
    --stroke: #D7E2EC;
    --ring: rgba(12, 144, 175, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Kufi Arabic', 'Plus Jakarta Sans',
    sans-serif;
    min-height: 100vh;
    background: radial-gradient(circle at 12% 10%, rgba(53, 215, 244, 0.2), transparent 38%),
    radial-gradient(circle at 90% 18%, rgba(12, 144, 175, 0.2), transparent 40%),
    var(--panel-bg);
    color: var(--text-dark);
    overflow-x: hidden;
}

.login-container {
    display: flex;
    min-height: 100vh;
}

.brand-panel {
    flex: 1;
    background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 52%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(2rem, 6vw, 4.5rem);
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: '';
    position: absolute;
    top: -45%;
    left: -35%;
    width: 180%;
    height: 180%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: moveBackground 24s linear infinite;
}

.brand-panel::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    bottom: -180px;
    inset-inline-end: -140px;
    filter: blur(4px);
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 26px);
    }
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 520px;
    animation: riseIn 0.75s ease both;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-logo {
    margin: 0 auto 1.7rem;
    display: inline-flex;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.brand-logo img {
    width: 145px;
    height: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.brand-logo img:hover {
    transform: scale(1.05);
}

.brand-title {

    font-family: 'Space Grotesk', 'Noto Kufi Arabic', 'Plus Jakarta Sans',
    sans-serif;
    font-size: clamp(2.1rem, 3.3vw, 3.15rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 1.08rem;
    opacity: 0.92;
    margin: 0 auto 2rem;
    font-weight: 400;
    max-width: 400px;
}

.gcc-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.gcc-badge {
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gcc-badge:hover {
    transform: translateY(-3px) scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.feature-list {
    text-align: start;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    transition: transform 0.25s ease, background 0.25s ease;

    
}

.feature-list li:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.feature-icon {
    width: 38px;
    height: 38px;
    background: rgba(12, 51, 65, 0.34);
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.8rem, 4vw, 3rem);
    background: linear-gradient(180deg, #F7FBFE 0%, #EDF2F8 100%);
    position: relative;
}

.form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 82%, rgba(53, 215, 244, 0.2), transparent 35%),
        radial-gradient(circle at 12% 16%, rgba(12, 144, 175, 0.16), transparent 32%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: clamp(2.5rem, 4vw, 3rem) clamp(2rem, 3vw, 2.5rem);
    box-shadow: 0 24px 48px -12px rgba(16, 34, 53, 0.15), 0 0 0 1px rgba(12, 144, 175, 0.05);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .login-logo {
    margin: 0 auto 1.5rem;
    display: inline-flex;
    height: 48px;
}

.login-header .login-logo img {
    width: auto;
    height: 100%;
    object-fit: contain;
}

.login-header h2 {

    font-family: 'Space Grotesk', 'Noto Kufi Arabic', 'Plus Jakarta Sans',
    sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: start;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    inset-inline-start: 1.2rem;
    color: #94A3B8;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-control {
    width: 100%;
    height: 52px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 0 1rem;
    padding-inline-start: 3.2rem;
    font-size: 0.95rem;
    color: #0F172A;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    background: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 144, 175, 0.1);
    outline: none;
}

.form-control:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-control::placeholder {
    color: #94A3B8;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 0.8rem;
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 8px;
}

.password-toggle:hover {
    color: var(--primary);
    background: #F1F5F9;
}

.input-wrapper.has-password .form-control {
    padding-inline-end: 3.2rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0;
    border: 1.5px solid #B6C6D6;
    border-radius: 0.35rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text-muted);
    font-size: 0.86rem;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.btn-login {
    width: 100%;
    height: 52px;
    background: var(--primary);
    border: 2px solid transparent;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(12, 144, 175, 0.2);
}

.btn-login:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(12, 144, 175, 0.3);
    transform: translateY(-1px);
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-login .spinner {
    display: none;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.alert {
    border: none;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: linear-gradient(135deg, #FFF1F1 0%, #FFE5E5 100%);
    color: #9F1C1C;
    border-inline-start: 4px solid #D63232;
}

.copyright {
    position: absolute;
    bottom: 1.1rem;
    text-align: center;
    color: #6B8196;
    font-size: 0.8rem;
    z-index: 1;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 1.5rem;
    inset-inline-end: 1.5rem;
    z-index: 10;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #D3DEE9;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px rgba(16, 34, 53, 0.08);
}

.lang-toggle:hover {
    border-color: #A9BFD3;
    background: #FFFFFF;
}

.lang-toggle .flag-icon {
    font-size: 1.05rem;
}

.lang-toggle i.fa-chevron-down {
    font-size: 0.65rem;
    color: #8096AA;
    transition: transform 0.2s;
}

.lang-dropdown:hover .lang-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    inset-inline-end: 0;
    margin-top: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(16, 34, 53, 0.14);
    border: 1px solid #E2EBF3;
    min-width: 158px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.lang-dropdown:hover .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.lang-option:hover {
    background: #F0F5FA;
}

.lang-option.active {
    background: linear-gradient(115deg, var(--primary) 0%, #0E7D9B 100%);
    color: white;
}

.lang-option .flag-icon {
    font-size: 1.2rem;
}

.lang-option .check-icon {
    margin-inline-start: auto;
    font-size: 0.8rem;
}

@media (max-width: 1100px) {
    .login-container {
        flex-direction: column;
    }

    .brand-panel {
        padding: 2.5rem 2rem;
        min-height: 40vh;
    }

    .feature-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .form-panel {
        min-height: 60vh;
    }

    .copyright {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 760px) {
    .brand-panel {
        min-height: auto;
        padding: 2rem 1.2rem 1.7rem;
    }

    .brand-subtitle {
        margin-bottom: 1rem;
    }

    .gcc-badges {
        margin-bottom: 1rem;
    }

    .feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-panel {
        padding: 1rem;
    }

    .login-card {
        border-radius: 22px;
        padding: 1.7rem 1.15rem;
    }

    .login-header h2 {
        font-size: 1.6rem;
    }

    .form-options {
        flex-wrap: wrap;
    }

    .language-selector {
        top: 0.8rem;
        inset-inline-end: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* RTL: feature list rows mirror */
[dir="rtl"] .feature-list li { flex-direction: row-reverse; }
