/* Login-only styling. Keep Roundcube's native form and authentication flow. */
body.task-login {
    position: relative;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: #08090c;
    color: #f6f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.task-login #spyderserve-video-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

body.task-login #layout {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding: 56px 24px 88px;
    background: transparent;
    overflow: visible;
}

body.task-login #layout-content {
    position: relative;
    flex: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 38px 38px 30px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 22px;
    background: rgba(15, 17, 23, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

body.task-login #logo {
    position: relative;
    top: 0;
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0 auto 34px;
    padding: 0;
    filter: brightness(0) invert(1);
}

body.task-login #login-form {
    position: relative;
    top: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

body.task-login .ss-login-heading {
    margin-bottom: 30px;
    text-align: center;
}

body.task-login .ss-login-heading h2 {
    margin: 0 0 8px;
    color: #f6f7fa;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -0.035em;
}

body.task-login .ss-login-heading p {
    margin: 0;
    color: #b7bcc8;
    font-size: 14px;
    line-height: 1.6;
}

body.task-login #login-form table,
body.task-login #login-form tbody {
    display: block;
    width: 100%;
    margin: 0;
}

body.task-login #login-form tr {
    display: block;
    width: 100%;
    margin: 0 0 20px;
}

body.task-login #login-form td.title {
    display: block !important;
    width: 100%;
    padding: 0;
    text-align: left;
}

body.task-login #login-form label,
body.task-login .ss-field-label {
    display: block;
    margin: 0 0 9px;
    color: #d6d9e2;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
}

body.task-login #login-form td.input {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    padding: 0;
    border: 1px solid #3b3f4b;
    border-radius: 10px;
    background: #17191f;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

body.task-login #login-form td.input:focus-within {
    border-color: #f27982;
    box-shadow: 0 0 0 3px rgba(242, 121, 130, 0.15);
}

body.task-login #login-form .input-group-prepend {
    align-self: stretch;
    margin: 0;
}

body.task-login #login-form .input-group-text {
    justify-content: center;
    min-width: 46px;
    padding: 0 10px 0 15px;
    border: 0;
    border-radius: 10px 0 0 10px;
    background: transparent;
    color: #a2a9b9;
    font-size: 16px;
}

body.task-login #login-form .form-control {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 12px 14px;
    border: 0 !important;
    border-radius: 10px !important;
    background: #17191f !important;
    color: #f6f7fa !important;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    caret-color: #f6f7fa;
    box-shadow: none !important;
}

body.task-login #login-form .input-group-prepend + .form-control {
    padding-left: 2px;
}

body.task-login #login-form .form-control::placeholder {
    color: #9da4b4;
    opacity: 1;
}

body.task-login #login-form input:-webkit-autofill,
body.task-login #login-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f6f7fa;
    -webkit-box-shadow: 0 0 0 1000px #17191f inset !important;
    caret-color: #f6f7fa;
}

body.task-login .ss-password-toggle {
    flex: 0 0 auto;
    min-width: 48px;
    min-height: 44px;
    margin: 2px 7px 2px 0;
    padding: 0 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #c8cedb;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
}

body.task-login .ss-password-toggle:hover {
    color: #fff;
}

body.task-login #login-form .formbuttons {
    margin: 26px 0 0;
    padding: 0;
}

body.task-login #rcmloginsubmit {
    display: block;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 13px 20px;
    border: 1px solid #d93240;
    border-radius: 10px;
    background: #d93240;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none !important;
    box-shadow: none;
    transition: background 150ms ease, border-color 150ms ease;
}

body.task-login #rcmloginsubmit:hover {
    border-color: #c82937;
    background: #c82937;
}

body.task-login #rcmloginsubmit:disabled {
    opacity: 0.65;
    cursor: wait;
}

body.task-login #login-footer {
    margin: 28px 0 0;
    padding: 23px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aeb5c4;
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

body.task-login #login-footer a {
    color: #e1e4ed;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.task-login #login-footer a:hover {
    color: #fff;
}

body.task-login .ss-video-toggle {
    position: absolute;
    bottom: 20px;
    left: 24px;
    z-index: 2;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    background: rgba(15, 17, 23, 0.9);
    color: #e1e4ed;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
}

body.task-login button:focus-visible,
body.task-login a:focus-visible {
    outline: 2px solid #f6a0a7;
    outline-offset: 4px;
}

body.task-login #messagestack {
    z-index: 1100;
}

@media (max-width: 520px) {
    body.task-login #layout {
        padding: 28px 18px 88px;
    }

    body.task-login #layout-content {
        padding: 32px 25px 26px;
        border-radius: 18px;
    }

    body.task-login #logo {
        width: 220px;
        margin-bottom: 28px;
    }

    body.task-login .ss-login-heading h2 {
        font-size: 27px;
    }

    body.task-login .ss-video-toggle {
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.task-login *,
    body.task-login *::before,
    body.task-login *::after {
        transition: none !important;
    }
}
