﻿
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ------------------------------ */
/* Base (Bootstrap-aware)         */
/* ------------------------------ */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    /* Prevent double scrollbar on desktop */
    height: 100vh;
    overflow: hidden;
    margin: 0;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--bs-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: color-mix(in srgb, var(--bs-primary) 85%, #000 15%);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bs-primary);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--bs-success);
}

.invalid {
    outline: 1px solid var(--bs-danger);
}

.validation-message {
    color: var(--bs-danger);
}

/* ------------------------------ */
/* Error UI                       */
/* ------------------------------ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121 url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjw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NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ------------------------------ */
/* Layout                         */
/* ------------------------------ */
.login-split-container {
    display: flex;
    height: 100vh; /* match viewport to stop body scroll */
    width: 100%;
    overflow: hidden; /* hide decorative overflow */
    background: var(--bs-body-bg);
}

/* Left Section - Branding (centered) */
.login-left-section {
    flex: 0 0 65%;
    background: linear-gradient(135deg, var(--bs-primary) 0%, color-mix(in srgb, var(--bs-primary) 70%, #000 30%) 100%);
    display: flex; /* ✅ keep flex */
    align-items: center; /* ✅ vertical center */
    justify-content: center; /* ✅ horizontal center */
    position: relative;
    overflow: hidden;
    animation: fadeInLeft 0.8s ease-out forwards;
    color: #fff;
    padding: 0 2rem; /* symmetric breathing room */
}

.brand-content {
    position: relative;
    z-index: 10;
    color: #fff;
    padding: 3rem;
    /* Center inner column */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.logo-wrapper {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
    padding: 0;
    will-change: transform;
}

    .logo-wrapper i {
        font-size: 4rem;
        color: #fff;
    }

.brand-logo {
    width: 130px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.preview-subtitle {
    font-size: 0.9rem;
    color: #f0f0f0;
    margin-top: .25rem;
}

.brand-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.95;
}


/* Align feature text to the left while keeping icon + text in a row */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start; /* ✅ left-align the whole block */
    justify-content: center;
    text-align: left; /* ✅ text left */
    max-width: 560px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* ✅ icon + text start from left */
    gap: .75rem;
    font-size: 1.1rem;
    opacity: 0.9;
    width: 100%; /* ✅ ensures alignment consistency */
}


.feature-item i {
        font-size: 1.5rem;
    }

/* Decorative circles */
.decorative-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    will-change: transform;
    content-visibility: auto;
    pointer-events: none;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    right: -75px;
    animation: float 10s ease-in-out infinite;
}

/* Right Section - Form (centered) */
.login-right-section {
    flex: 0 0 35%;
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    background: var(--bs-light);
    padding: 0; /* remove extra padding */
    animation: fadeInRight 0.8s ease-out;
    height: 100vh;
    overflow: auto; /* single scroll region */
    -webkit-overflow-scrolling: touch;
    /* Safe-area padding minimal to avoid mis-centering */
    padding-top: calc(0rem + env(safe-area-inset-top));
    padding-bottom: calc(0rem + env(safe-area-inset-bottom));
    padding-left: calc(0rem + env(safe-area-inset-left));
    padding-right: calc(0rem + env(safe-area-inset-right));
}

/* Form container */
.login-form-container {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: auto; /* ensure centering */
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header h2 {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--bs-dark);
        margin-top: 0;
    }

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

.form-label {
    color: var(--bs-secondary-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ------------------------------ */
/* Beta badges                    */
/* ------------------------------ */
.beta-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    margin-left: 8px;
    display: inline-block;
}

.betalogin-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--bs-primary);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 1px;
    display: inline-block;
}

/* ------------------------------ */
/* Divider                        */
/* ------------------------------ */
.divider-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin: 1rem 0;
}

    .divider-text::before,
    .divider-text::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .divider-text:not(:empty)::before {
        margin-right: 1rem;
    }

    .divider-text:not(:empty)::after {
        margin-left: 1rem;
    }

    .divider-text span {
        color: var(--bs-secondary);
        font-size: 0.875rem;
        font-weight: 500;
        background: #fff;
        padding: 0 10px;
        position: relative;
        z-index: 1;
        display: inline-block;
    }

/* ------------------------------ */
/* Provider buttons (icon-safe)   */
/* ------------------------------ */
.auth-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin-right: .5rem;
}

.auth-logo-wrapper {
    display: inline-flex;
    align-items: center;
}

/* Microsoft */
.btn-microsoft-auth {
    background-color: #ffffff;
    color: #111;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color .2s ease, box-shadow .2s ease, transform .02s ease;
}

    .btn-microsoft-auth:hover {
        background-color: #f5f5f5;
    }

    .btn-microsoft-auth:active {
        transform: translateY(0.5px);
    }

    .btn-microsoft-auth:focus {
        outline: 3px solid #99c2ff;
        outline-offset: 2px;
    }

/* Google */
.btn-google-auth {
    background-color: #ffffff;
    color: #1f1f1f;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color .2s ease, box-shadow .2s ease, transform .02s ease;
}

    .btn-google-auth:hover {
        background-color: #f7f7f7;
    }

    .btn-google-auth:active {
        transform: translateY(0.5px);
    }

    .btn-google-auth:focus {
        outline: 3px solid #9ed0ff;
        outline-offset: 2px;
    }

/* Buttons size */
.btn-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* ------------------------------ */
/* RTL awareness                  */
/* ------------------------------ */
html[dir="rtl"] body,
html[dir="rtl"] .login-success-container {
    font-family: "Tajawal", "Cairo", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.7;
}

html[dir="rtl"] h1 {
    font-family: "Cairo", "Tajawal", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 700;
}

[dir="rtl"] .me-1 {
    margin-left: .25rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .me-2 {
    margin-left: .5rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* ------------------------------ */
/* Animations                     */
/* ------------------------------ */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ------------------------------ */
/* Responsive                     */
/* ------------------------------ */

/* Default: show both sections — KEEP FLEX (do NOT set block) */
.login-left-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    /* Allow natural page scrolling on mobile/tablet stacks */
    html, body {
        height: auto;
        overflow: auto;
    }

    .login-split-container {
        flex-direction: column;
        height: auto;
    }

    .login-left-section {
        min-height: 300px;
        padding: 2rem;
    }

    .brand-title {
        font-size: 2.5rem;
    }

    .brand-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }

    .brand-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }

    .feature-item {
        font-size: 0.9rem;
    }

    .login-form-container {
        padding: 2rem;
    }

    .login-right-section {
        overflow: visible;
    }
    /* page scrolls */
}

/* Right side logo - hide on desktop, show on mobile */
.form-logo-wrapper {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .login-left-section {
        display: none;
    }

    .login-right-section {
        width: 100%;
        padding: 1.25rem; /* small breathing room on mobile */
        align-items: flex-start; /* start at top so keyboard doesn't hide it */
        justify-content: center;
        min-height: 100vh;
    }

    .form-logo-wrapper {
        display: block; /* show on mobile */
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Small mobile */
@media (max-width: 576px) {
    .login-left-section {
        min-height: 250px;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }

        .logo-wrapper i {
            font-size: 2.5rem;
        }

    .brand-title {
        font-size: 2rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }

    .brand-features {
        display: none;
    }

    .login-form-container {
        padding: 1.5rem;
    }

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

/* ------------------------------ */
/* Form-top inline logo (optional) */
/* ------------------------------ */
.form-logo {
    width: 130px;
    height: 40px;
    margin: 0 auto;
    background-color: var(--bs-primary);
    /* -webkit-mask/mask commented by design */
}

/* ------------------------------ */
/* Theming                        */
/* ------------------------------ */
:root[data-theme="fluent-custom"] {
    --bs-primary: var(--custom-primary, #0d6efd);
    --bs-link-color: var(--custom-primary, #0d6efd);
    --bs-focus-ring-color: color-mix(in oklab, var(--custom-primary, #0d6efd), transparent 70%);
}

    :root[data-theme="fluent-custom"] .btn-primary,
    :root[data-theme="fluent-custom"] .dxbs-btn-primary {
        --bs-btn-bg: var(--custom-primary, #0d6efd);
        --bs-btn-border-color: var(--custom-primary, #0d6efd);
        --bs-btn-hover-bg: color-mix(in oklab, var(--custom-primary, #0d6efd), black 10%);
        --bs-btn-hover-border-color: color-mix(in oklab, var(--custom-primary, #0d6efd), black 12%);
        --bs-btn-active-bg: color-mix(in oklab, var(--custom-primary, #0d6efd), black 14%);
        --bs-btn-active-border-color: color-mix(in oklab, var(--custom-primary, #0d6efd), black 16%);
    }

:root[data-theme="fluent-dark-custom"] {
    --bs-primary: var(--custom-primary, #4f46e5);
    --bs-link-color: var(--custom-primary, #4f46e5);
    --bs-focus-ring-color: color-mix(in oklab, var(--custom-primary, #4f46e5), transparent 70%);
}

    :root[data-theme="fluent-dark-custom"] .btn-primary,
    :root[data-theme="fluent-dark-custom"] .dxbs-btn-primary {
        --bs-btn-bg: var(--custom-primary, #4f46e5);
        --bs-btn-border-color: var(--custom-primary, #4f46e5);
        --bs-btn-hover-bg: color-mix(in oklab, var(--custom-primary, #4f46e5), white 8%);
        --bs-btn-hover-border-color: color-mix(in oklab, var(--custom-primary, #4f46e5), white 8%);
        --bs-btn-active-bg: color-mix(in oklab, var(--custom-primary, #4f46e5), white 12%);
        --bs-btn-active-border-color: color-mix(in oklab, var(--custom-primary, #4f46e5), white 12%);
    }

