/* Account/Login: the two-panel sign-in on the workspace shell
   (css/workspace-auth.css supplies the tokens, header and footer). */

.login-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: clamp(16px, 3.5vh, 40px);
}

/* Auto margins centre the card in whatever height the screen leaves,
   with the footer kept at the bottom. */
.login-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.07fr) minmax(440px, .93fr);
    width: 100%;
    min-height: min(68vh, 720px);
    margin-block: auto;
    overflow: hidden;
    background: var(--wa-surface);
    border: 1px solid var(--wa-hairline);
    border-radius: 24px;
    box-shadow: var(--wa-shadow);
}

/* ---------- Story panel ---------- */

.login-story {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: 56px 54px 30px;
    overflow: hidden;
    background: linear-gradient(145deg, #eef4ff, #f8f5ff);
    border-right: 1px solid var(--wa-hairline);
}

[data-bs-theme="dark"] .login-story {
    background: linear-gradient(145deg, #13213d, #211c3d);
}

    .login-story::before {
        content: "";
        position: absolute;
        z-index: -1;
        right: -260px;
        bottom: 40px;
        width: 510px;
        height: 510px;
        border: 1px solid rgba(37, 99, 235, .14);
        border-radius: 50%;
        box-shadow: 0 0 0 54px rgba(37, 99, 235, .04), 0 0 0 108px rgba(37, 99, 235, .03), 0 0 0 162px rgba(37, 99, 235, .02);
    }

    .login-story::after {
        content: "";
        position: absolute;
        z-index: -1;
        right: 70px;
        bottom: 65px;
        width: 320px;
        height: 320px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(96, 165, 250, .22), transparent 70%);
        filter: blur(18px);
    }

    .login-story h1 {
        max-width: 570px;
        margin: 22px 0 18px;
        color: var(--wa-ink);
        font-size: clamp(34px, 3.5vw, 50px);
        font-weight: 700;
        line-height: 1.18;
        letter-spacing: -.035em;
    }

.login-story-intro {
    max-width: 460px;
    margin: 0;
    color: var(--wa-muted);
    font-size: 15px;
    line-height: 1.8;
}

.login-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
    height: 278px;
    margin: 26px 0 16px;
    pointer-events: none;
}

.login-orbit {
    position: absolute;
    width: 465px;
    height: 165px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 50%;
    transform: rotate(-14deg);
}

    .login-orbit.second {
        width: 380px;
        height: 205px;
        transform: rotate(22deg);
    }

.login-preview {
    position: relative;
    width: 314px;
    height: 208px;
    overflow: hidden;
    background: var(--wa-frost);
    border: 1px solid var(--wa-hairline);
    border-radius: 18px;
    box-shadow: 0 24px 50px rgba(30, 64, 175, .14);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    transform: rotate(-7deg);
}

[data-bs-theme="dark"] .login-preview {
    box-shadow: 0 24px 50px rgba(0, 0, 0, .3);
}

.login-preview-top {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 15px;
    border-bottom: 1px solid var(--wa-hairline);
}

    .login-preview-top i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

        .login-preview-top i:nth-child(1) { background: var(--wa-mark-blue); }
        .login-preview-top i:nth-child(2) { background: var(--wa-mark-violet); }
        .login-preview-top i:nth-child(3) { background: var(--wa-mark-green); }

    .login-preview-top span {
        margin-left: auto;
        color: var(--wa-muted);
        font-size: 8px;
        font-weight: 700;
        letter-spacing: .13em;
    }

.login-preview-body {
    padding: 18px;
}

    .login-preview-body strong {
        display: block;
        margin-bottom: 4px;
        color: var(--wa-ink);
        font-size: 17px;
        letter-spacing: -.02em;
    }

    .login-preview-body small {
        color: var(--wa-muted);
        font-size: 10px;
    }

.login-preview-tiles {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 9px;
    margin-top: 16px;
}

.login-tile {
    height: 70px;
    padding: 11px;
    overflow: hidden;
    background: var(--wa-surface-alt);
    border: 1px solid var(--wa-hairline);
    border-radius: 10px;
}

    .login-tile small {
        display: block;
        font-size: 9px;
    }

.login-tile-metric {
    color: var(--wa-brand-text);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.4;
}

.login-tile-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 29px;
    margin-top: 4px;
}

    .login-tile-bars i {
        display: block;
        width: 14px;
        border-radius: 4px 4px 0 0;
        background: var(--wa-mark-blue);
    }

        .login-tile-bars i:nth-child(1) { height: 35%; }
        .login-tile-bars i:nth-child(2) { height: 65%; background: #c4b5fd; }
        .login-tile-bars i:nth-child(3) { height: 50%; }
        .login-tile-bars i:nth-child(4) { height: 85%; background: var(--wa-mark-pink); }
        .login-tile-bars i:nth-child(5) { height: 100%; background: #60a5fa; }

.login-art .wa-float-chip.hr { left: 0; top: 55px; }
.login-art .wa-float-chip.qa { right: 3px; top: 30px; }
.login-art .wa-float-chip.lms { right: 10px; bottom: 25px; }

.login-sparkle {
    position: absolute;
    top: 16px;
    left: 80px;
    color: #a5b4fc;
    font-size: 23px;
}

.login-story-bottom {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: auto;
    color: var(--wa-muted-strong);
    font-size: 12px;
    line-height: 1.55;
}

    .login-story-bottom svg {
        flex: none;
        width: 18px;
        height: 18px;
        color: var(--wa-success);
    }

/* ---------- Sign-in panel ---------- */

.login-auth {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 50px 30px;
    background: var(--wa-surface);
}

.login-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    background: linear-gradient(140deg, #eff6ff, #f5f3ff);
    border: 1px solid var(--wa-hairline);
    border-radius: 14px;
}

[data-bs-theme="dark"] .login-mark {
    background: var(--wa-surface-subtle);
}

    .login-mark img {
        width: 26px;
        height: 26px;
    }

.login-heading {
    margin: 0 0 8px;
    color: var(--wa-ink);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.25;
}

    .login-heading span {
        color: var(--wa-brand-text);
    }

.login-subtitle {
    margin: 0 0 22px;
    color: var(--wa-muted);
    font-size: 14px;
    line-height: 1.7;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.login-field label {
    color: var(--wa-muted-strong);
    font-size: 13px;
    font-weight: 600;
}

.login-link {
    color: var(--wa-brand-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

    .login-link:hover {
        color: var(--wa-brand-hover);
        text-decoration: underline;
    }

.login-input-wrapper {
    position: relative;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 46px 0 44px;
    color: var(--wa-ink);
    background: var(--wa-input);
    border: 1px solid var(--wa-hairline);
    border-radius: 11px;
    outline: none;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

    .login-input::placeholder {
        color: #94a3b8;
    }

    .login-input:focus {
        background: var(--wa-surface);
        border-color: #93b4fb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--wa-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    transform: translateY(-50%);
    cursor: pointer;
}

    .password-toggle:hover {
        color: var(--wa-brand-text);
        background: var(--wa-surface-alt);
    }

    .password-toggle svg {
        width: 18px;
        height: 18px;
    }

.remember-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--wa-muted-strong);
    font-size: 13px;
    cursor: pointer;
}

    .remember-wrapper input {
        width: 17px;
        height: 17px;
        margin: 0;
        accent-color: var(--wa-brand);
        cursor: pointer;
    }

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background-color .2s;
}

    .login-button svg {
        width: 16px;
        height: 16px;
    }

.login-submit {
    margin-top: 2px;
    color: #fff;
    background: var(--wa-gradient-fill);
    box-shadow: 0 9px 22px rgba(37, 99, 235, .2);
}

    .login-submit:hover:not(:disabled) {
        color: #fff;
    }

    .login-submit:disabled {
        opacity: .75;
        cursor: not-allowed;
    }

.login-submit-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.login-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--wa-muted);
    font-size: 11px;
    letter-spacing: .04em;
}

    .login-divider::before,
    .login-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--wa-hairline);
    }

.login-demo {
    color: var(--wa-muted-strong);
    background: var(--wa-surface-alt);
    border: 1px solid var(--wa-hairline);
}

    .login-demo svg {
        color: var(--wa-accent);
    }

.login-signup {
    margin: 20px 0 0;
    color: var(--wa-muted);
    font-size: 13px;
    text-align: center;
}

/* ---------- Validation ---------- */

.field-validation-error {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 12px;
}

[data-bs-theme="dark"] .field-validation-error {
    color: #f87171;
}

.field-validation-valid,
.validation-summary-valid {
    display: none;
}

.input-validation-error {
    border-color: #f87171 !important;
}

    .input-validation-error:focus {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, .12) !important;
    }

.validation-summary-errors {
    padding: 11px 13px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 13px;
}

[data-bs-theme="dark"] .validation-summary-errors {
    color: #fecaca;
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

.login-auth .alert {
    margin-bottom: 16px;
}

.d-none {
    display: none !important;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .login-stage { grid-template-columns: minmax(0, 1fr) minmax(400px, .95fr); }
    .login-story { padding: 48px 36px 28px; }
    .login-auth { padding: 40px 36px; }
    .login-art { transform: scale(.9); }
}

/* Tablet and phone: the sign-in panel on its own. */
@media (max-width: 900px) {
    .login-stage { grid-template-columns: 1fr; min-height: 0; max-width: 560px; margin-inline: auto; }
    .login-story { display: none; }
    .login-auth { padding: 40px 44px; }
    .login-main .wa-footer { width: 100%; max-width: 560px; margin-inline: auto; }
}

@media (max-width: 590px) {
    .login-main { padding-top: 16px; }
    .login-stage { border-radius: 20px; }
    .login-auth { padding: 30px 22px 26px; }
    .login-heading { font-size: 26px; }
    .login-subtitle { margin-bottom: 18px; }
}

/* Laptop-height screens (1366x768, 1280x720, 1440x900 with browser
   chrome): a tighter card so the page fits without scrolling. */
@media (max-height: 860px) {
    .login-stage { min-height: 0; }
    .login-story { padding: 34px 40px 22px; }
    .login-story h1 { margin: 14px 0 12px; font-size: clamp(30px, 5.4vh, 44px); }
    .login-story-intro { font-size: 14px; line-height: 1.7; }
    .login-art { height: 210px; margin: 8px 0 8px; transform: scale(.78); }
    .login-auth { padding: 26px 44px 22px; }
    .login-mark { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; }
    .login-mark img { width: 22px; height: 22px; }
    .login-heading { font-size: 26px; margin-bottom: 4px; }
    .login-subtitle { margin-bottom: 16px; }
    .login-form { gap: 12px; }
    .login-field-head { margin-bottom: 6px; }
    .login-input,
    .login-button { height: 44px; }
    .login-signup { margin-top: 14px; }
}

@media (max-height: 720px) {
    .login-mark { display: none; }
    .login-art { height: 170px; transform: scale(.66); margin: 0; }
    .login-story h1 { font-size: clamp(28px, 5vh, 36px); }
    .login-auth { padding-block: 20px 18px; }
    .login-form { gap: 10px; }
}

/* Very short windows (phone in landscape): drop the decoration and scroll. */
@media (max-height: 560px) {
    .login-story { display: none; }
    .login-stage { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
}
