﻿:root {
    --header-width: 1260px;
    --header-height-nav: 48px;
    --primary: #004683;
    --brand-primary: #075f98;
    --brand-primary-dark: #054a78;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --border-color: #e0e0e0;
    --secondary: #075f98;
    --navbar-light: #f8f9fa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

#mainForm {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
}

main {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.site-header {
    top: 0;
    color: white;
    position: sticky;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 1000;
    border-bottom: 0 none;
    background: linear-gradient(90deg, var(--primary) 0%, #0088cc 55%, #006eab 100%);
}

[dir="rtl"] .site-header {
    background: linear-gradient(270deg, var(--primary) 0%, #0088cc 55%, #006eab 100%);
}

.site-header::before {
    content: '';
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.site-header::after {
    content: '';
    left: -5%;
    width: 400px;
    bottom: -30%;
    height: 400px;
    position: absolute;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

.header-container {
    display: block;
    margin: 0 auto 0 auto;
    max-width: var(--header-width);
    padding-top: 0.5rem;
}

.header-container a {
    color: #fff;
    text-decoration: none;
}

.header-container a:hover {
    cursor: pointer;
}

.site-brand {
    margin: 0;
    padding: 0 0.5rem 0.2rem 0.5rem;
    flex-shrink: 1;
    min-width: 260px;
    position: relative;
}

[dir="ltr"] .site-brand {
    margin-right: 1.6rem;
}

[dir="rtl"] .site-brand {
    margin-left: 1.6rem;
}

.site-brand a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-brand-overlay {
    position: absolute;
    top: -20px;
    left: 59%;
    transform: translateX(-55%);
    z-index: 10005;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.site-brand-overlay .nav-link {
    padding: 2px 25px;
    margin: 5px 0px -5px;
    transform: scaleX(1.5);
    font-stretch: expanded;
}

.site-brand-overlay:hover {
    background-color: rgba(7, 95, 152, 0.80);
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.85);
}

.site-brand-overlay:has(#UsersList-tab.active) {
    border-top: none;
    background-color: rgba(108, 117, 125, 1);
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.85);
}

.site-logo {
    width: 70px;
    height: 70px;
    border: none;
    padding: 0.2rem;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: -1px -1px 3px rgba(255,255,255,0.9), 1px 1px 3px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.15);
}

.site-titles {
    line-height: 1.2;
    min-width: 240px;
}

[dir="ltr"] .site-titles {
    margin-left: 0.60rem;
    font-family: 'Roboto', sans-serif;
}

[dir="rtl"] .site-titles {
    margin-right: 0.60rem;
    font-family: 'El Messiri', sans-serif;
}

.site-title {
    color: #ffffff;
    margin: 0 0 5px 0;
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-subtitle {
    margin: 0;
    color: rgba(255,255,255,0.8);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

[dir="ltr"] .site-title {
    font-size: 1.2rem;
}
[dir="rtl"] .site-title {
    font-size: 1.3rem;
}

[dir="ltr"] .site-subtitle {
    font-size: 0.8rem;
}
[dir="rtl"] .site-subtitle {
    font-size: 0.9rem;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #f1f3f4;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    padding: 6px 10px;
    width: 100%;
    transition: all 0.2s ease-in-out;
}

.search-box:hover {
    background-color: #e8eaed;
}

.search-box:focus-within {
    background-color: #ffffff;
    border-color: #1a73e8;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100% !important;
    font-size: 16px;
    color: #3c4043;
    width: 100%;
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-container {
    padding: 0;
    display: inline-flex;
    flex-wrap: nowrap;
    overflow: hidden;
    margin: 1px 7px -5px 7px;
}

.tab-container span {
    display: inline-block;
    margin: 0px 5px 0px 5px;
    flex-shrink: 0;
}

.tab-container input[type="radio"] {
    display: none;
}

.tab-container label, .navbar-text {
    color: #fff;
    /*bottom: -2px;*/
    cursor: pointer;
    display: block;
    padding: 6px 20px;
    position: relative;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 12px 12px 0 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab-container label .bi {
    padding: 0;
    margin: -15px -5px;
    font-weight: 600;
    font-size: 1.0rem;
}

.tab-container label:hover {
    background-color: #eaeaea;
    color: #333;
}

.navbar-nav {
    border: 0px none;
}

.navbar-text:hover {
    background-color: #eaeaea;
    color: #333;
}

.navbar-text:hover,
.navbar-text:hover .nav-item,
.navbar-text:hover a.nav-item {
    color: #333;
}

    .navbar-text:has(a.nav-item.active) {
        background-color: var(--navbar-light);
        border-color: #e0e0e0 #e0e0e0 #ffffff #e0e0e0;
        font-weight: bold;
        color: var(--brand-primary);
    }

    .navbar-text:hover a.nav-item,
    .navbar-text a.nav-item.active {
        color: #333;
    }


.tab-container input[type="radio"]:checked + label {
    background-color: var(--navbar-light);
    border-color: #e0e0e0 #e0e0e0 #ffffff #e0e0e0;
    font-weight: bold;
    color: var(--brand-primary);
}

.site-footer {
    color: #6c757d;
    padding: 0.25rem 1rem;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
    background-color: #f8f9fa;
    text-align: center;
    font-size: small;
}

.site-footer a {
    color: #6c757d;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--brand-primary);
}

#loadingOverlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 110, 171, 0.15);
    backdrop-filter: blur(3px);
    z-index: 1010;
    align-items: center;
    justify-content: center;
}

#loadingOverlay.visible {
    display: flex;
}

#loadingOverlay.hidden {
    display: none !important;
}

.loading-content {
    background: #ffffff;
    border-radius: .75rem;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,110,171,.25);
    border-top: 4px solid #006eab;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #cce6f4;
    border-top: 5px solid #006eab;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #006eab;
    font-weight: 600;
    font-size: .95rem;
}

.masthead-row {
    row-gap: 0.5rem;
}

.navbar-toggler {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: 4px 10px;
    line-height: 1;
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.lang-button a.flip-animate {
    perspective: 1000px;
    display: inline-block; /* Ensure perspective works */
}

.lang-button a.flip-animate span {
    width: 50px;
    position: relative;
    display: inline-block;
    padding: 0;
    transition: transform 0.3s;
    transform-origin: 50% 0;
    transform-style: preserve-3d;
}

.lang-button a.flip-animate span:before {
    position: absolute;
    left: 0;
    width: 100%;
    content: attr(data-hover);
    transition: color 0.3s;
    transform: rotateX(-90deg);
    transform-origin: 50% 0;
    text-align: end;
}

/* Replaces &:hover span */
.lang-button a.flip-animate:hover span,
.lang-button a.flip-animate:focus span {
    transform: rotateX(90deg) translateY(-22px);
}

/* Replaces &:hover span:before */
.lang-button a.flip-animate:hover span:before,
.lang-button a.flip-animate:focus span:before {
    color: #fff;
    font-weight: 500;
}


/* Public Access Section */
.public-section {
    background: linear-gradient(135deg, #e8f4ff 0%, #f0f9ff 100%);
    padding: 3rem 2rem;
    border-radius: 12px;
    margin: 3rem 0;
    border: 2px solid #b3d9ff;
}

.public-section .section-title {
    color: var(--primary);
}

.public-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.public-action {
    background: white;
    padding: 1.7rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.public-action:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--secondary);
}

.public-action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.public-action h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.public-action p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.public-action .btn-outline {
    background: #0185c7;
    color: white;
    border: 2px solid white;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.public-action .btn-outline:hover {
    background: #0169a0;
    color: white;
}

/* Scoped: nothing here can leak into, or be changed by, the rest of the site */
.otp-login {
    --otp-brand: #006eab;
    --otp-brand-bg: #e8f4fa;
    --otp-border: #dee2e6;
    width: 100%;
    min-width: 0;
}

.otp-login .otp-body {
    min-height: 300px;
}

.otp-login .otp-digits {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.otp-login .otp-digit {
    width: clamp(2.25rem, 12vw, 2.75rem);
    height: 3.1rem;
    min-width: 0;
    padding: 0;
    border: 2px solid var(--otp-border);
    border-radius: .5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--otp-brand);
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.otp-login .otp-digit:focus {
    border-color: var(--otp-brand);
    box-shadow: 0 0 0 3px rgba(0,110,171,.15);
    outline: none;
}

.otp-login .otp-digit.filled {
    border-color: var(--otp-brand);
    background: var(--otp-brand-bg);
}

.otp-login .otp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}








/* ------ Mobile Styles -------- */

@media (max-width: 767px) {

    .tab-container input[id$="_0"],
    .tab-container input[id$="_0"] + label {
        display: none !important;
    }

    .site-header::before {
        right: -20%;
        width: 300px;
        height: 300px;
    }

    .site-header::after {
        left: -25%;
        width: 200px;
        height: 200px;
    }

    .search-lang-row {
        flex: 0 0;
        min-width: 325px;
        padding: 0 0.5rem;
        margin: 0.5rem 0.7rem 1.2rem 0.7rem;
    }

    .site-logo {
        width: 60px;
        height: 60px;
    }

    .site-titles {
        min-width: 160px;
    }

    .lang-button .bi {
        display: none;
    }

    [dir="ltr"] .site-title {
        font-size: 0.95rem;
    }

    [dir="rtl"] .site-title {
        font-size: 1.1rem;
    }

    [dir="ltr"] .site-subtitle {
        font-size: 0.6rem;
    }

    [dir="rtl"] .site-subtitle {
        font-size: 0.75rem;
    }

    #mainNavCollapse {
        width: 100%;
    }

    nav.container {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-nav {
        width: 100%;
    }

    .navbar-text {
        border-radius: 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        margin: -3px 8px 5px;
    }

    .navbar-text:hover {
        background-color: #eaeaea;
        color: #333;
    }

    .navbar-text:hover,
    .navbar-text:hover .nav-item,
    .navbar-text:hover a.nav-item {
        color: #333;
    }

    .tab-container {
        flex-direction: column;
        margin-bottom: 5px;
        width: 100%;
    }

    .tab-container span {
        display: block;
        margin: 0;
        width: 100%;
    }

    .tab-container label {
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        background: transparent;
        color: #fff;
    }

    .tab-container input[type="radio"]:checked + label {
        background-color: rgba(255,255,255,0.15);
        border-color: transparent;
        color: #fff;
        font-weight: bold;
    }
}

/* Make sure this value is higher than your sticky header's z-index */
.modal {
    z-index: 1060 !important;
}

/* Make sure the dark backdrop sits right underneath the modal, but above the header */
.modal-backdrop {
    z-index: 1050 !important;
}
