@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&display=swap");

/* TripleZero iT Webmail login — same layout as loginwebmail.nl, own brand assets */

html {
    -webkit-text-size-adjust: 100%;
}

body.task-login,
body.task-login #layout,
body.task-login #layout-content {
    width: 100% !important;
    min-height: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    background-color: transparent !important;
    overflow-x: hidden;
}

body.task-login {
    background-color: #e7eef2 !important;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.78),
            rgba(255, 255, 255, 0.78)
        ),
        url("../images/background.jpg") !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    color: #1a1a1a !important;
}

body.task-login #layout-content {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100% !important;
    padding: 32px 16px 120px !important;
}

body.task-login .login-brand {
    display: block;
    text-align: center;
    position: relative !important;
    top: 0 !important;
    margin: 0 auto !important;
    max-width: 100%;
}

/* Wide TripleZero wordmark — keep proportions */
body.task-login .login-brand #logo,
body.task-login #logo {
    position: relative !important;
    top: 0 !important;
    width: min(420px, calc(100vw - 40px)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: min(420px, calc(100vw - 40px)) !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

body.task-login .login-webmail-label {
    display: block;
    text-align: center;
    margin: 0.7rem auto 0;
    padding: 0;
    font-family: "Nunito", "Segoe UI", sans-serif !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    letter-spacing: 0.14em;
    color: #111111 !important;
    text-transform: uppercase;
}

body.task-login #login-form {
    position: relative !important;
    top: 0 !important;
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: 360px !important;
    margin: 1.35rem auto 0 !important;
}

body.task-login #login-form .form-control,
body.task-login #login-form .btn,
body.task-login #login-form button {
    min-height: 44px;
}

body.task-login #login-form .form-control {
    font-size: 16px !important;
    background-color: #fff !important;
    color: #18202c !important;
}

body.task-login #login-form .btn-primary,
body.task-login #login-form button,
body.task-login #login-form input[type="submit"] {
    background-color: #18202c !important;
    border-color: #18202c !important;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

body.task-login #login-form .btn-primary:hover,
body.task-login #login-form button:hover,
body.task-login #login-form input[type="submit"]:hover {
    background-color: #243044 !important;
    border-color: #243044 !important;
    color: #fff !important;
}

body.task-login a,
body.task-login a:visited {
    color: #18202c !important;
}

body.task-login a:hover,
body.task-login a:focus {
    color: #243044 !important;
    text-decoration: underline !important;
}

/* Focus ring from the TripleZero logo purple */
body.task-login #login-form .form-control:focus,
body.task-login #login-form .form-control:focus-visible,
body.task-login #login-form .input-group:focus-within .form-control,
body.task-login #login-form .input-group:focus-within .input-group-text {
    border-color: #4c3d86 !important;
    outline: none !important;
    box-shadow: none !important;
}
body.task-login #login-form .input-group:focus-within {
    border-radius: 4px;
    box-shadow: 0 0 0 2px #4c3d86 !important;
}

body.task-login #login-form .input-group-text,
body.task-login #login-form .input-group-text.icon::before {
    color: #18202c !important;
    background-color: #fff !important;
}

body.task-login #login-footer {
    display: none !important;
}

#lw-page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-family: Nunito, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #5c6573;
    background: linear-gradient(to top, rgba(255,255,255,0.88) 35%, rgba(255,255,255,0));
    pointer-events: auto;
}

#lw-page-footer .lw-copy {
    line-height: 1.3;
}

#lw-page-footer .lw-powered {
    margin-top: 3px;
    font-size: 11px;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #8a93a0;
    line-height: 1.3;
}

#lw-lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    margin: 0 auto 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#lw-lang-toggle:hover,
#lw-lang-toggle:focus,
#lw-lang-toggle:focus-visible {
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
}

#lw-lang-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background: rgba(24, 32, 44, 0.45);
}

#lw-lang-modal[hidden] {
    display: none !important;
}

.lw-lang-panel {
    width: min(760px, 100%);
    max-height: min(80vh, 680px);
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(24, 32, 44, 0.28);
    padding: 0;
}

#lw-langs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 16px 12px 16px 16px;
    width: 100%;
    max-height: min(80vh, 680px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(24, 32, 44, 0.35) transparent;
}

#lw-langs::-webkit-scrollbar {
    width: 10px;
}

#lw-langs::-webkit-scrollbar-track {
    background: transparent;
    margin: 18px 0;
}

#lw-langs::-webkit-scrollbar-thumb {
    background: rgba(24, 32, 44, 0.28);
    border-radius: 999px;
    border: 2px solid #fff;
}

#lw-langs .lw-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(24, 32, 44, 0.08);
    border-radius: 10px;
    background: #f6f7f9;
    color: #18202c;
    font-family: Nunito, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: start;
    cursor: pointer;
}

#lw-langs .lw-lang .lw-flag {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

#lw-langs .lw-lang .lw-name {
    min-width: 0;
}

#lw-langs .lw-lang:hover {
    background: #fff;
    border-color: rgba(24, 32, 44, 0.28);
}

#lw-langs .lw-lang.is-active {
    background: #fff;
    border-color: #18202c;
    box-shadow: 0 0 0 2px #18202c;
}

/* Keep the light login layout when the browser prefers dark mode */
html.dark-mode body.task-login,
html.dark-mode body.task-login #layout,
html.dark-mode body.task-login #layout-content {
    background-color: transparent !important;
    color: #1a1a1a !important;
}

html.dark-mode body.task-login {
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.78),
            rgba(255, 255, 255, 0.78)
        ),
        url("../images/background.jpg") !important;
}

html.dark-mode body.task-login .login-webmail-label,
html.dark-mode #lw-page-footer {
    color: #5c6573 !important;
}

html.dark-mode body.task-login .login-webmail-label {
    color: #111111 !important;
}

html.dark-mode body.task-login #login-form .form-control,
html.dark-mode body.task-login #login-form .input-group-text {
    background-color: #fff !important;
    color: #18202c !important;
    border-color: #ced4da !important;
}

@media (min-width: 1024px) {
    body.task-login {
        background-attachment: fixed !important;
    }
}

@media (max-width: 1023px) {
    body.task-login {
        background-attachment: scroll !important;
    }
}

@media (max-width: 768px) {
    body.task-login .login-brand #logo,
    body.task-login #logo {
        width: min(320px, calc(100vw - 32px)) !important;
        max-width: min(320px, calc(100vw - 32px)) !important;
    }
    body.task-login .login-webmail-label {
        font-size: 17px !important;
        letter-spacing: 0.12em !important;
    }
    #lw-page-footer {
        font-size: 13px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 640px) {
    #lw-langs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px 8px 12px 12px;
    }
}

@media (max-height: 740px) {
    html:not(.login-tall) body.task-login #layout-content {
        justify-content: flex-start;
        padding-top: 20px !important;
    }
    html:not(.login-tall) body.task-login .login-brand #logo,
    html:not(.login-tall) body.task-login #logo {
        width: min(280px, calc(100vw - 32px)) !important;
        max-width: min(280px, calc(100vw - 32px)) !important;
    }
    html:not(.login-tall) body.task-login .login-webmail-label {
        margin-top: 0.35rem !important;
        font-size: 15px !important;
    }
    html:not(.login-tall) body.task-login #login-form {
        margin-top: 0.85rem !important;
    }
}

/* Keep the mobile login still when the keyboard opens. */
html.login-kb-lock,
html.login-kb-lock body.task-login {
    height: var(--login-lock-h, 100vh) !important;
    min-height: var(--login-lock-h, 100vh) !important;
    max-height: var(--login-lock-h, 100vh) !important;
    overflow: hidden !important;
}
html.login-kb-lock body.task-login {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    background-attachment: scroll !important;
}
html.login-kb-lock body.task-login #layout,
html.login-kb-lock body.task-login #layout-content {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
}
html.login-kb-lock #lw-page-footer {
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: 0;
}
