/* ============================================================
   loginNew.css — New B2C-style login/auth pages
   ============================================================ */

/* --- Font faces --- */
@font-face {
    font-family: Inter;
    src: url('../fonts/Inter/Inter_18pt-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: Inter;
    src: url('../fonts/Inter/Inter_18pt-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* --- CSS Variables --- */
:root {
    --primary: #01a2b7;
    --primary-dark: #03606B;
    --secondary: #f9bd00;
    --background-clear: #FFFFFF;
    --background-disabled: #c3d4da;
    --text-black: #000000;
    --text-disabled: #6e6e6e;
    --disabled: #b6b6b6;
    --primary-light: #00b6cb;
    --background-primary: #f2f2f2;
    --secondary-dark: #e5a901;
    --primary-dark2: #00424c;
    --invalid-color: #dc3545;
}

/* --- Reset --- */
*,
::after,
::before {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-black);
}

/* --- Background pattern --- */
.background-pattern {
    background-color: var(--primary);
    position: absolute;
    inset: 0;
    z-index: 0;
}

.background-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/pattern_aquilone.svg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}

/* --- Container --- */
.auth-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-clear);
}

/* --- Login box --- */
.login-box {
    display: flex;
    flex-direction: row;
    width: 90%;
    max-width: 912px;
    height: 680px;
    max-height: calc(100vh - 40px);
    background-color: var(--background-clear);
    border-radius: 8px;
    padding: 32px;
    z-index: 1;
    gap: 28px;
    box-shadow: 0 4px 16px var(--text-black);
    overflow-y: hidden;
}

.login-box::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.login-box::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 8px;
    margin-bottom: 8px;
}

.login-box::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background-color: var(--background-disabled);
    border-radius: 4px;
}

/* --- Left panel --- */
.left-panel {
    flex: 45;
    border-right: 1px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.left-panel .logo {
    width: 227px;
    height: auto;
}

.left-panel .slogan {
    color: var(--primary-dark);
    font-size: 16px;
    text-align: center;
    margin-top: 24px;
    max-width: 300px;
}

/* --- Right panel --- */
.right-panel {
    flex: 55;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow-y: auto;
    scrollbar-color: var(--background-disabled) transparent;
    scrollbar-width: thin;
    padding-right: 8px;
    padding-left: 4px;
}

.right-panel::after,
.right-panel::before {
    content: "";
    margin: auto;
}

/* --- Headings --- */
.right-panel h1 {
    font-size: 30px;
    font-weight: 400;
    color: #3d3c3c;
    margin-bottom: 20px;
}

/* --- Forms --- */
.right-panel form {
    width: 100%;
}

/* --- Floating labels --- */
.float-label {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.float-label > label {
    position: absolute;
    left: 10px;
    top: 28px;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-disabled);
    transition: 0.2s ease-out;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    user-select: none;
    order: 1;
    width: calc(100% - 20px);
}

.float-label > input,
.float-label > .password-wrapper > input {
    width: 100%;
    padding: 20px 40px 6px 10px;
    height: 56px;
    border: 1px solid var(--background-disabled);
    border-radius: 2px;
    font-size: 16px;
    outline: none;
    background: transparent;
    z-index: 1;
    order: 2;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.float-label > input::placeholder,
.float-label > .password-wrapper > input::placeholder {
    color: transparent;
    opacity: 0;
}

/* Float up on focus */
.float-label:focus-within > label {
    top: 5px;
    transform: none;
    font-size: 13px;
    color: var(--text-disabled);
}

/* Float up when input has content (via :placeholder-shown) */
.float-label:has(> input:not(:placeholder-shown)) > label {
    top: 5px;
    transform: none;
    font-size: 13px;
    color: var(--text-disabled);
}

/* Float up on autofill */
.float-label:has(> input:-webkit-autofill) > label {
    top: 5px;
    transform: none;
    font-size: 13px;
    color: var(--text-disabled);
    transition: none !important;
}

/* Password wrapper floating label support */
    .float-label:has(> .password-wrapper input:not([hidden]):focus) > label {
        top: 5px;
        transform: none;
        font-size: 13px;
        color: var(--text-disabled);
    }

    .float-label:has(> .password-wrapper input:not([hidden]):not(:placeholder-shown)) > label {
        top: 5px;
        transform: none;
        font-size: 13px;
        color: var(--text-disabled);
    }

    .float-label:has(> .password-wrapper input:not([hidden]):-webkit-autofill) > label {
        top: 5px;
        transform: none;
        font-size: 13px;
        color: var(--text-disabled);
        transition: none !important;
    }

/* --- Input focus ring --- */
.float-label > input:focus,
.float-label > .password-wrapper > input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-light) 25%, transparent);
}

/* --- Input validation error --- */
.float-label > input.input-validation-error,
.float-label > .password-wrapper > input.input-validation-error,
.float-label > input.highlightError,
.float-label > .password-wrapper > input.highlightError {
    border-color: var(--invalid-color) !important;
    box-shadow: none !important;
}

.float-label > input.input-validation-error:focus,
.float-label > .password-wrapper > input.input-validation-error:focus,
.float-label > input.highlightError:focus,
.float-label > .password-wrapper > input.highlightError:focus {
    border-color: var(--invalid-color) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--invalid-color) 25%, transparent) !important;
}

/* Validation messages */
.float-label .text-danger,
.float-label .field-validation-error {
    display: block;
    color: var(--invalid-color);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    margin-top: 6px;
    order: 3;
}

.float-label .field-validation-valid {
    display: none;
}

/* --- Password wrapper --- */
.password-wrapper {
    position: relative;
    width: 100%;
    order: 2;
}

.password-wrapper input {
    width: 100%;
    padding: 20px 40px 6px 10px;
    height: 56px;
    border: 1px solid var(--background-disabled);
    border-radius: 2px;
    font-size: 16px;
    outline: none;
    background: transparent;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.password-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-disabled);
    z-index: 2;
    font-size: 16px;
}

    .password-icon:focus-visible {
        outline: 2px solid var(--primary-dark2);
        border-radius: 2px;
    }

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* --- Buttons --- */
.btn-login-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary);
    border: 2px solid var(--secondary);
    color: var(--text-black);
    cursor: pointer;
    border-radius: 2px;
    margin-top: 60px;
    line-height: 1.5;
    text-transform: uppercase;
    font-weight: 400;
    text-decoration: none;
}

.btn-login-primary:hover,
.btn-login-primary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-login-primary:focus {
    box-shadow: 0 0 0 0.25rem var(--primary-dark2);
}

.btn-login-primary:disabled {
    opacity: 1;
    background-color: var(--disabled);
    border-color: var(--disabled);
    color: var(--background-primary);
    cursor: not-allowed;
}

/* --- Error messages (page level) --- */
.auth-error-message {
    background-color: transparent;
    font-weight: 500;
    color: var(--invalid-color);
    display: block;

    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 2px;
    font-size: 13px;
    text-align: left;
    position: relative;
}

    .auth-error-message:empty {
        display: none;
    }

/* Warning icon inside error message */
    .auth-error-message:not([aria-hidden="true"]):not(:empty)::before {
        content: "";
        display: inline-block;
        width: 18px;
        height: 18px;
        /* SVG Warning Icon (Outlined Rounded Triangle with !) - var(--invalid-color) */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        margin-right: 8px;
        flex-shrink: 0;
        vertical-align: middle;
    }

/* --- Forgot password link --- */
.forgot-password-block {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password-block a {
    color: var(--primary-dark2);
    font-size: 14px;
    text-decoration: none;
}

.forgot-password-block a:hover {
    text-decoration: underline;
}

/* --- Legal links footer --- */
.legal-links {
    width: 100%;
    justify-content: center;
    display: flex;
    flex-direction: row;
    text-align: center;
    margin-top: auto;
    padding-top: 16px;
}

.legal-links a {
    margin-top: 0;
    font-size: 13px;
    color: var(--text-disabled);
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 2px;
    background-color: transparent;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.legal-links a:hover {
    color: var(--primary-dark);
}

.legal-links a:focus-visible {
    border-color: transparent;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

.legal-links span {
    display: flex;
    align-items: center;
    color: var(--text-disabled);
}

/* --- Hide old copyright / footer --- */
.copyright,
.footer {
    display: none !important;
}

/* --- Kendo overrides for SelezionaCliente dropdown --- */
.right-panel .k-dropdownlist {
    background-color: transparent;
    width: 100%;
    height: 56px;
    border: 1px solid var(--background-disabled);
    border-radius: 2px;
    font-size: 16px;
}

.right-panel .k-dropdownlist * {
    color: var(--primary-dark2) !important;
}

.k-dropdownlist-popup * {
    color: var(--primary-dark2) !important;
}

.k-dropdownlist-popup li {
    margin-bottom: 0 !important;
}

.k-dropdownlist-popup li .k-list-item-text {
    margin-top: 5px;
    margin-bottom: 5px;
}

.k-dropdownlist-popup .k-selected {
    background-color: #018293 !important;
}

.k-dropdownlist-popup .k-selected * {
    color: white !important;
}

/* --- Responsive: tablet and below --- */
@media screen and (max-width: 768px) {
    .login-box {
        flex-direction: column;
        height: 720px;
        max-height: calc(100vh - 40px);
        padding: 24px;
        width: 90%;
        max-width: 912px;
        gap: 23px;
        overflow-y: auto;
        scrollbar-color: var(--background-disabled) transparent;
        scrollbar-width: thin;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--primary);
        padding: 16px;
        flex: 1;
    }

        .left-panel .slogan {
            font-size: 14px;
            margin-top: 12px;
        }

    /*.right-panel {
        padding-right: 0;
        padding-left: 0;
    }*/
}

/* --- Responsive: mobile --- */
@media (max-width: 576px) {
    .login-box {
        height: 720px;
        overflow-y: auto;
        scrollbar-color: var(--background-disabled) transparent;
        scrollbar-width: thin;
    }

    .left-panel .slogan {
        max-width: 100%;
    }

    .right-panel {
        padding: 0;
        overflow-y: unset;
    }

    .right-panel h1 {
        font-size: 24px;
    }

    .legal-links a {
        font-size: 11px;
    }
}

/* --- Very short screens --- */
@media (max-height: 680px) {
    .login-box {
        height: 580px;
        overflow-y: auto;
        scrollbar-color: var(--background-disabled) transparent;
        scrollbar-width: thin;
    }

    .left-panel {
        justify-content: center;
        padding: 0;
    }
}

@media screen and (max-width: 768px) and (max-height: 680px) {
    .right-panel {
        padding: 0;
        overflow-y: unset;
    }
}

@media (max-height: 480px) and (min-width: 769px) {
    .login-box {
        display: flex;
        flex-direction: row;
        overflow-y: auto;
        scrollbar-color: var(--background-disabled) transparent;
        scrollbar-width: thin;
    }

    .left-panel {
        border-bottom: none;
    }

    /*.right-panel {
        font-size: 15px;
        gap: 8px;
    }*/

    .right-panel h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }
}
