/* ── Login page styles ───────────────────────────────────────────────────── */

/* ── Login card (glass container) ── */
.login-card {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    padding: 2.75rem 2.75rem 2.25rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.company-logo {
    filter: brightness(1.1);
    max-height: 64px;
    object-fit: contain;
}

/* ── Video background ── */
.login-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease-in-out;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
}

body.dark-mode .video-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.65) 0%, rgba(5, 10, 30, 0.55) 100%);
}

body.light-mode .video-overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(200, 220, 255, 0.25) 100%);
}

/* ── Clock (fixed bottom-left on desktop) ── */
.time-date {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    pointer-events: none;
}

.time {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

.date {
    font-size: 1rem;
    opacity: 0.85;
}

body.dark-mode .time-date {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

body.light-mode .time-date {
    color: #1a1a1a;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.6);
}

/* ── Branding ── */
.app-title,
.app-subtitle {
    transition: color 0.4s ease;
}

body.dark-mode .app-title {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

body.dark-mode .app-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

body.light-mode .app-title {
    color: #0a0a0a;
    text-shadow: 2px 2px 6px rgba(255, 255, 255, 0.6);
}

body.light-mode .app-subtitle {
    color: rgba(20, 20, 20, 0.8);
}

/* ── Social links ── */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.35s ease;
    backdrop-filter: blur(12px);
    border: 1px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

body.dark-mode .social-links a {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .social-links a:hover {
    background: linear-gradient(135deg, #00aeff, #005bff);
    color: #fff;
    border-color: rgba(0, 174, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 174, 255, 0.5);
    transform: translateY(-4px) scale(1.08);
}

body.light-mode .social-links a {
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .social-links a:hover {
    background: linear-gradient(135deg, #ffb300, #ff6f00);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.5);
    transform: translateY(-4px) scale(1.08);
}

.social-links a:nth-child(1) { animation: floaty 5s ease-in-out infinite 0.0s; }
.social-links a:nth-child(2) { animation: floaty 5s ease-in-out infinite 0.3s; }
.social-links a:nth-child(3) { animation: floaty 5s ease-in-out infinite 0.6s; }
.social-links a:nth-child(4) { animation: floaty 5s ease-in-out infinite 0.9s; }
.social-links a:nth-child(5) { animation: floaty 5s ease-in-out infinite 1.2s; }

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

/* ── Sign-in button ── */
.btn-glass {
    background: linear-gradient(135deg, rgba(0, 174, 255, 0.9), rgba(0, 91, 255, 0.85));
    border: none;
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-size: .95rem;
    min-height: 52px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 174, 255, 0.45);
    position: relative;
    overflow: hidden;
}

.btn-glass::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.55s ease, height 0.55s ease;
}

.btn-glass:hover::before  { width: 300px; height: 300px; }
.btn-glass:hover          { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 174, 255, 0.55); }
.btn-glass:active         { transform: translateY(0); }
.btn-glass:disabled       { opacity: 0.6; cursor: not-allowed; transform: none; pointer-events: none; }

.btn-glass .spinner-border { width: 1.1rem; height: 1.1rem; border-width: 2px; }

/* ── Input wrapper (floating label + icon) ── */
.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1.75rem;
}

.input-wrapper i.input-icon {
    position: absolute;
    top: 50%; left: 1rem;
    transform: translateY(-50%);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.input-wrapper .toggle-password {
    position: absolute;
    top: 50%; right: 1rem;
    transform: translateY(-50%);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: color 0.25s ease;
    z-index: 2;
}

.input-wrapper .toggle-password:hover { color: #00aeff; }
.input-wrapper:focus-within i.input-icon {
    color: #00aeff;
    transform: translateY(-50%) scale(1.1);
}

/* Base input (glass) */
.input-wrapper .form-control {
    width: 100%;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 12px;
    padding: 1.05rem 3rem;
    font-size: .97rem;
    min-height: 52px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-wrapper .form-control::placeholder { color: transparent; }

.input-wrapper .form-control:focus {
    background: rgba(255, 255, 255, 0.13);
    border-color: #00aeff;
    box-shadow: 0 0 0 3px rgba(0, 174, 255, 0.2);
    color: #fff;
}

.input-wrapper .form-control.jx-err,
.otp-digit-box.jx-err {
    border-color: #ff4757 !important;
    background: rgba(255, 71, 87, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.18) !important;
}
.input-wrapper .form-control.jx-err ~ .input-icon { color: #ff4757; }

.input-wrapper .form-control.is-invalid {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.08);
}

.input-wrapper .form-control.is-valid {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.08);
}

/* Floating label */
.input-wrapper label {
    position: absolute;
    top: 50%; left: 3rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.input-wrapper .form-control:focus ~ label,
.input-wrapper .form-control:not(:placeholder-shown) ~ label {
    top: -0.6rem;
    left: 2.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #00aeff;
    background: rgba(10, 15, 30, 0.75);
    border-radius: 4px;
    padding: 0 0.4rem;
}

/* Validation feedback */
.input-wrapper .invalid-feedback {
    color: #ff6b6b;
    font-size: 0.82rem;
    margin-top: 0.4rem;
    margin-left: 0.75rem;
    display: none;
    animation: slideDown 0.25s ease;
}

.input-wrapper .form-control.is-invalid ~ .invalid-feedback { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Checkbox ── */
.form-check-input {
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.form-check-input:checked {
    background-color: #00aeff;
    border-color: #00aeff;
}

/* ── Inline alert ── */
.alert-custom {
    border-radius: 10px;
    border: none;
    backdrop-filter: blur(12px);
    animation: slideDown 0.25s ease;
    font-size: 0.88rem;
    padding: 0.75rem 1rem;
}

.alert-custom.alert-danger {
    background: rgba(255, 71, 87, 0.18);
    color: #ff6b6b;
    border: 1px solid rgba(255, 71, 87, 0.35);
}

.alert-custom.alert-success {
    background: rgba(46, 213, 115, 0.18);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.35);
}

.alert-custom .btn-close-white { filter: brightness(2); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Portal type tags ── */
.portal-tag {
    display: inline-flex;
    align-items: center;
    padding: .3rem .9rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    gap: .25rem;
}

.employee-tag {
    background: rgba(46, 213, 115, 0.12);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.client-tag {
    background: rgba(162, 155, 254, 0.12);
    border: 1px solid rgba(162, 155, 254, 0.3);
    color: #a29bfe;
}

.partner-tag {
    background: rgba(255, 170, 0, 0.12);
    border: 1px solid rgba(255, 170, 0, 0.3);
    color: #ffaa00;
}

.admin-tag {
    background: rgba(0, 174, 255, 0.12);
    border: 1px solid rgba(0, 174, 255, 0.3);
    color: #00aeff;
}

/* ── Shake animation ── */
@keyframes jxShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-9px); }
    30%       { transform: translateX(9px); }
    45%       { transform: translateX(-6px); }
    60%       { transform: translateX(6px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

.login-card.shake { animation: jxShake 0.55s ease; }

/* ── Employee badge ── */
.employee-badge {
    background: rgba(46, 213, 115, 0.18);
    border: 1px solid rgba(46, 213, 115, 0.35);
    color: #2ed573;
    box-shadow: 0 0 24px rgba(46, 213, 115, 0.2);
}

/* ── Client / portal badge ── */
.client-badge {
    background: rgba(155, 89, 182, 0.18);
    border: 1px solid rgba(155, 89, 182, 0.4);
    color: #a29bfe;
    box-shadow: 0 0 24px rgba(162, 155, 254, 0.2);
}

/* ── Card logo ── */
.card-logo-wrap {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 18px;
}

.card-logo-fallback {
    display: none;
    width: 76px;
    height: 76px;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 174, 255, 0.2), rgba(0, 91, 255, 0.2));
    border: 1px solid rgba(0, 174, 255, 0.35);
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
}

.card-logo-fallback span { color: #00e6b8; }

/* ── Card-view swap transitions ── */
.card-view { width: 100%; }

@keyframes viewExitLeft {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-22px); }
}
@keyframes viewExitRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(22px); }
}
@keyframes viewEnterRight {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes viewEnterLeft {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}

.view-exit-left   { animation: viewExitLeft   .24s ease forwards; }
.view-exit-right  { animation: viewExitRight  .24s ease forwards; }
.view-enter-right { animation: viewEnterRight .24s ease forwards; }
.view-enter-left  { animation: viewEnterLeft  .24s ease forwards; }

/* ── Registration step panels ── */
.reg-step-panel { display: none; }
.reg-step-panel.active { display: block; }

.reg-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .75rem;
}

.reg-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all .3s ease;
    flex-shrink: 0;
}

.reg-step-dot.active {
    background: #00aeff;
    box-shadow: 0 0 0 3px rgba(0, 174, 255, 0.25);
    width: 20px;
    border-radius: 4px;
}

.reg-step-dot.done { background: #2ed573; }

/* ── Back button in reg view ── */
#backToLoginBtn {
    line-height: 1;
    transition: opacity .2s;
}
#backToLoginBtn:hover { opacity: 1 !important; }

/* ── Dev OTP hint box ── */
.reg-dev-hint {
    padding: .6rem .9rem;
    border-radius: 10px;
    background: rgba(255, 170, 0, 0.09);
    border: 1px solid rgba(255, 170, 0, 0.25);
    margin-bottom: 1.25rem;
}

/* ── Area autocomplete dropdown ── */
.area-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(8, 14, 34, 0.98);
    border: 1px solid rgba(0, 174, 255, 0.22);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 160px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.area-suggestion-item {
    padding: .55rem 1rem;
    font-size: .87rem;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background .18s, color .18s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.area-suggestion-item:last-child { border-bottom: none; }
.area-suggestion-item:hover { background: rgba(0, 174, 255, 0.1); color: #00aeff; }

/* ── Select fields (inside reg modal) ── */
.reg-field-group { margin-bottom: 1.75rem; }

.reg-field-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: .4rem;
    padding-left: .3rem;
    letter-spacing: .04em;
}

.reg-select-wrap { position: relative; }

.reg-select-wrap .input-icon {
    position: absolute;
    top: 50%; left: 1rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.reg-select-wrap .reg-chevron {
    position: absolute;
    top: 50%; right: 1rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: .7rem;
    pointer-events: none;
    z-index: 2;
}

.reg-select-wrap select.form-control {
    padding-left: 3rem;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-height: 52px;
}

.reg-select-wrap select.form-control option {
    background: #0a0e1e;
    color: #fff;
}

/* ── Registration success panel ── */
.reg-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0 .5rem;
}

.reg-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(46, 213, 115, 0.1);
    border: 2px solid rgba(46, 213, 115, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #2ed573;
    margin-bottom: 1.25rem;
}

/* ── Reg terms checkbox ── */
.reg-terms-label {
    font-size: .84rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.reg-terms-label.error { color: #ff6b6b; }

/* ── Mobile adjustments ── */
@media (max-width: 991.98px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 1.25rem;
    }
}

/* ── Portal badges ── */
.portal-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 1.75rem;
    backdrop-filter: blur(12px);
}

.partner-badge {
    background: rgba(255, 170, 0, 0.18);
    border: 1px solid rgba(255, 170, 0, 0.35);
    color: #ffaa00;
    box-shadow: 0 0 24px rgba(255, 170, 0, 0.2);
}

.admin-badge {
    background: rgba(0, 174, 255, 0.18);
    border: 1px solid rgba(0, 174, 255, 0.35);
    color: #00aeff;
    box-shadow: 0 0 24px rgba(0, 174, 255, 0.2);
}

/* ── MFA overlay panel ── */
.mfa-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    z-index: 10;
}

/* The card needs position:relative so the overlay sits inside it */
.login-card { position: relative; }

/* ── OTP digit boxes ── */
.otp-digit-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.otp-digit-box {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    caret-color: #00e6b8;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}

.otp-digit-box:focus {
    border-color: rgba(0, 174, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(0, 174, 255, 0.14);
    background: rgba(0, 174, 255, 0.05);
}

.otp-digit-box.filled {
    border-color: rgba(0, 230, 184, 0.5);
    background: rgba(0, 230, 184, 0.06);
}

.otp-digit-box.error {
    border-color: rgba(255, 107, 107, 0.6);
    background: rgba(255, 107, 107, 0.06);
}

@media (max-width: 400px) {
    .otp-digit-box { width: 38px; height: 46px; font-size: 1.25rem; gap: 7px; }
    .otp-digit-row { gap: 7px; }
}

/* ── Shorter desk screens (Nov 9 2026): the app cards belong at the bottom centre (jx.appget.js docks them there only
   while the sign-in card stays clear of them, else it moves them beside the clock). A 768–920 px tall laptop had the card
   reaching the bottom, so it is drawn tighter here, and on the shortest screens sits higher. ── */
@media (min-width: 992px) and (max-height: 920px) {
    .login-card { padding: 1.6rem 2.25rem 1.4rem; }
    .login-card .card-logo-wrap, .login-card .card-logo, .login-card .card-logo-fallback { width: 50px; height: 50px; }
    .login-card .card-logo-wrap { margin-bottom: .55rem !important; }
    .login-card > .text-center.mb-4, .login-card .card-view > .text-center.mb-4 { margin-bottom: .9rem !important; }
    .login-card hr { margin: 0 0 1.1rem !important; }
    .login-card .input-wrapper { margin-bottom: 1.05rem; }
    .login-card .d-flex.mb-4 { margin-bottom: 1rem !important; }
    .login-card .jx-doors { margin-top: .9rem; }
    .login-card .jx-doors-div { margin-bottom: .55rem; }
    .login-card .jx-door-btn { padding: .45rem .7rem; }
    .login-card .jx-door-ico { width: 30px; height: 30px; }
}
@media (min-width: 992px) and (max-height: 820px) {
    .container-fluid > .row.vh-100 { align-items: flex-start !important; }
    .container-fluid > .row.vh-100 > .col-lg-6:last-child { padding-top: 1rem !important; padding-bottom: 0 !important; }
    .container-fluid > .row.vh-100 > .col-lg-6:first-child { align-self: center; }
}

/* ── The company's own logo (Nov 28 2026, the owner: "the logos in the login page look small"): a wide logo, not the
   square JedexOS icon - the sizes above were made for the icon (90 px beside, a 76 px square on the card). ── */
.jx-brand-side { width: min(260px, 80%); max-height: 120px; height: auto; object-fit: contain; }
.card-logo-wrap.is-wide { width: auto; height: auto; min-height: 64px; }
.card-logo.is-wide { width: auto; height: auto; max-width: 240px; max-height: 64px; border-radius: 0; }
@media (max-width: 576px) {
    .jx-brand-side { max-height: 84px; }
    .login-card .card-logo-wrap.is-wide { width: auto; height: auto; min-height: 48px; }
    .login-card .card-logo.is-wide { width: auto; height: auto; max-width: 200px; max-height: 48px; }
}
/* "Runs on JedexOS" readable on both (it was white on the light page) */
.jx-runs-on { color: rgba(255, 255, 255, .7); }
body.light-mode .jx-runs-on { color: rgba(15, 23, 42, .6); }
