/* Layout pagine com_users — profilo/MFA + login come registrazione */

/*====22/07/2026 — gs-login-helix — stesso flex layout di #member-registration====*/
#com-users-login__form {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

body.view-login .com-users-login {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#com-users-login__form .control-group {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#com-users-login__form legend {
    max-width: 700px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    text-align: left !important;
    display: block !important;
}

#com-users-login__form fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#com-users-login__form .control-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

#com-users-login__form .control-group .control-label {
    float: none;
    width: auto;
    min-width: 150px;
    flex: 0 0 150px;
    padding: 0;
    text-align: left;
}

#com-users-login__form .control-group label {
    display: block;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    min-width: 150px;
    text-align: left;
}

#com-users-login__form .control-group .controls {
    flex: 1;
    float: none;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    position: relative;
}

#com-users-login__form .control-group .controls input,
#com-users-login__form .control-group .controls .form-control {
    width: 100%;
    box-sizing: border-box;
}

#com-users-login__form .password-group,
#com-users-login__form .input-group {
    width: 100%;
}

#com-users-login__form .input-group .form-control {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

#com-users-login__form .controls .input-password-toggle {
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
}

#com-users-login__form .controls input[type="password"],
#com-users-login__form .controls input[type="text"] {
    padding-right: 40px !important;
}

#com-users-login__form .com-users-login__remember:not(:has(input, label, .form-check)),
#com-users-login__form .com-users-login__remember .controls:not(:has(input, label, .form-check)) {
    display: none;
}

#com-users-login__form .com-users-login__submit.control-group {
    padding-left: calc(150px + 1.2rem);
}

#com-users-login__form .com-users-login__submit .controls .btn {
    width: auto;
}

body.view-login .com-users-login__links {
    margin: 0;
    padding: 0 0 0 calc(150px + 1.2rem);
    width: 100%;
    box-sizing: border-box;
}

body.view-login .com-users-login__links a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.85rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    position: relative;
    z-index: 2;
}

body.view-login .com-users-login__links li + li a {
    margin-top: -1px;
}

body.view-login .com-users-login__links a:hover,
body.view-login .com-users-login__links a:focus {
    background: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

body.dark-mode .com-users-login__links a {
    background: #242424;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .com-users-login__links a:hover,
body.dark-mode .com-users-login__links a:focus {
    background: #2e2e2e;
}

@media (max-width: 768px) {
    #com-users-login__form .control-group,
    body.view-login .com-users-login {
        max-width: 100%;
    }

    body.view-login .com-users-login__links {
        padding-left: 0;
    }

    body.view-login .com-users-login__links a {
        white-space: normal;
    }

    #com-users-login__form .com-users-login__submit.control-group {
        padding-left: 0;
    }
}

/* Overlay Helix invisibile ma pointer-events:auto → primo click assorbito */
body.com_users:not(.offcanvas-active) .offcanvas-overlay {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

body.com_users.offcanvas-active .offcanvas-overlay {
    display: block !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.com-users-profile,
.com-users-profile__edit,
.gs-users-panel {
    max-width: 720px;
    margin: 1.5rem auto 2.5rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

body.dark-mode .com-users-profile,
body.dark-mode .com-users-profile__edit,
body.dark-mode .gs-users-panel {
    background: #242424;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f0f0f0;
}

.com-users-profile__edit .control-group,
.com-users-profile dl {
    margin-bottom: 1rem;
}

.com-users-profile__edit input[type="text"],
.com-users-profile__edit input[type="email"],
.com-users-profile__edit input[type="password"],
.com-users-profile__edit select,
.com-users-profile__edit textarea {
    max-width: 100%;
}

.com-users-profile__edit-submit .btn-primary {
    min-width: 120px;
}

.com-users-profile dl dt {
    font-weight: 600;
    margin-top: 0.75rem;
}

.com-users-profile dl dd {
    margin-bottom: 0.25rem;
    margin-left: 0;
}

@media (max-width: 767px) {
    .com-users-profile,
    .com-users-profile__edit,
    .gs-users-panel {
        margin: 1rem;
        padding: 1rem;
    }
}
