/* ─── Login page — Light theme ─── */
html:has(body.ws-login-page) {
    height: 100%;
    overflow: hidden;
}

body.ws-login-page {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    overflow: hidden;
    font-family: var(--ws-font-family);
    font-size: var(--ws-font-size);
    line-height: var(--ws-line-height);
    color: var(--ws-text);
    background:
        radial-gradient(ellipse 90% 60% at 10% 0%, rgba(99, 102, 241, 0.09), transparent 55%),
        radial-gradient(ellipse 70% 50% at 95% 20%, rgba(16, 185, 129, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(59, 130, 246, 0.06), transparent 55%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 45%, #eef2ff 100%);
}

.ws-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ws-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
}

.ws-login-orb-1 {
    width: 520px;
    height: 520px;
    background: rgba(99, 102, 241, 0.18);
    top: -12%;
    left: -8%;
    animation: wsFloat 14s ease-in-out infinite;
}

.ws-login-orb-2 {
    width: 420px;
    height: 420px;
    background: rgba(16, 185, 129, 0.14);
    bottom: -8%;
    right: 5%;
    animation: wsFloat 16s ease-in-out infinite reverse;
}

.ws-login-orb-3 {
    width: 320px;
    height: 320px;
    background: rgba(59, 130, 246, 0.12);
    top: 35%;
    right: -6%;
    animation: wsFloat 11s ease-in-out infinite;
}

.ws-login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black, transparent);
}

@keyframes wsFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(16px, -18px) scale(1.03); }
}

.ws-login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(16px, 2vh, 24px) clamp(24px, 3vw, 40px);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

/* Illustration side */
.ws-login-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.ws-login-illustration-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(14px, 2vh, 20px);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
}

.ws-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.ws-login-logo {
    height: 52px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.ws-login-badge {
    padding: 6px 14px;
    border-radius: var(--ws-radius-full);
    background: linear-gradient(135deg, var(--ws-indigo-50), var(--ws-emerald-50));
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--ws-indigo-700);
    font-size: var(--ws-font-size);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ws-login-hero-copy h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vh, var(--ws-font-size-3xl));
    font-weight: 800;
    color: var(--ws-slate-900);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ws-login-hero-copy h1 span {
    background: linear-gradient(135deg, var(--ws-indigo-600), var(--ws-emerald-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ws-login-hero-copy p {
    margin: 0;
    font-size: var(--ws-font-size-lg);
    font-weight: 500;
    color: var(--ws-slate-500);
    line-height: 1.55;
    max-width: 460px;
}

/* Feature pills */
.ws-login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ws-login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--ws-font-size-lg);
    color: var(--ws-slate-600);
    font-weight: 500;
}

.ws-login-feature-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ws-radius-sm);
    background: #fff;
    border: 1px solid var(--ws-border);
    color: var(--ws-indigo-600);
    font-size: 15px;
    box-shadow: var(--ws-shadow-xs);
}

/* Visual illustration */
.ws-login-visual {
    position: relative;
    flex-shrink: 0;
    height: clamp(140px, 18vh, 200px);
}

.ws-illustration-panel {
    position: absolute;
    inset: 0;
    border-radius: var(--ws-radius-xl);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        var(--ws-shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.ws-illustration-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.07), transparent 40%);
}

.ws-illustration-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    border-radius: var(--ws-radius-lg);
    background: linear-gradient(145deg, var(--ws-indigo-500), var(--ws-emerald-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow:
        0 16px 40px rgba(99, 102, 241, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.ws-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: var(--ws-font-size);
    border-radius: var(--ws-radius-md);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--ws-border);
    color: var(--ws-slate-700);
    font-weight: 600;
    box-shadow: var(--ws-shadow-sm);
    z-index: 3;
}

.ws-float-card .bi {
    font-size: 16px;
    color: var(--ws-emerald-600);
}

.ws-float-card-1 { top: 18%; left: 8%; animation: wsFloat 8s ease-in-out infinite; }
.ws-float-card-2 { top: 12%; right: 8%; animation: wsFloat 10s ease-in-out infinite 1s; }
.ws-float-card-3 { bottom: 18%; left: 12%; animation: wsFloat 9s ease-in-out infinite 0.5s; }

.ws-login-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding: 10px 14px;
    border-radius: var(--ws-radius-md);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--ws-border);
    font-size: var(--ws-font-size);
    color: var(--ws-slate-500);
}

.ws-login-trust .bi {
    color: var(--ws-emerald-600);
    font-size: 16px;
}

/* Login form side */
.ws-login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.ws-login-mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ws-login-mobile-brand img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.ws-login-mobile-brand span {
    padding: 4px 12px;
    border-radius: var(--ws-radius-full);
    background: var(--ws-indigo-50);
    color: var(--ws-indigo-700);
    font-size: var(--ws-font-size-sm);
    font-weight: 600;
}

.ws-login-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: clamp(28px, 3vh, 36px) clamp(28px, 2.5vw, 36px) clamp(22px, 2.5vh, 28px);
    border-radius: var(--ws-radius-xl);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.02),
        0 20px 50px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.ws-login-card-glow {
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--ws-indigo-500), var(--ws-emerald-500));
    opacity: 0.85;
}

.ws-login-card-header {
    text-align: center;
    margin-bottom: clamp(18px, 2.2vh, 24px);
}

.ws-login-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: var(--ws-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ws-indigo-500), var(--ws-emerald-500));
    color: #fff;
    font-size: 24px;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.28);
}

.ws-login-card-header h2 {
    margin: 0 0 6px;
    font-size: var(--ws-font-size-2xl);
    font-weight: 800;
    color: var(--ws-slate-900);
    letter-spacing: -0.02em;
}

.ws-login-card-header p {
    margin: 0;
    font-size: var(--ws-font-size-lg);
    font-weight: 500;
    color: var(--ws-slate-500);
}

/* Form fields */
.ws-form-field {
    margin-bottom: clamp(14px, 1.8vh, 18px);
}

.ws-form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--ws-font-size-lg);
    font-weight: 600;
    color: var(--ws-slate-700);
}

.ws-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ws-input-wrap > .bi {
    position: absolute;
    left: 14px;
    color: var(--ws-slate-400);
    font-size: 16px;
    pointer-events: none;
    transition: var(--ws-transition);
}

.ws-input-wrap .form-control {
    width: 100%;
    padding: 11px 44px 11px 42px;
    border-radius: var(--ws-radius-md);
    border: 1.5px solid var(--ws-slate-200);
    background: var(--ws-slate-50);
    color: var(--ws-slate-800);
    font-size: var(--ws-font-size-lg);
    font-weight: 500;
    transition: var(--ws-transition);
}

.ws-input-wrap .form-control::placeholder {
    color: var(--ws-slate-400);
}

.ws-input-wrap .form-control:hover {
    border-color: var(--ws-slate-300);
    background: #fff;
}

.ws-input-wrap .form-control:focus {
    outline: none;
    border-color: var(--ws-indigo-500);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.ws-input-wrap:focus-within > .bi {
    color: var(--ws-indigo-500);
}

.ws-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--ws-slate-400);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--ws-transition);
    border-radius: 6px;
}

.ws-password-toggle:hover {
    color: var(--ws-indigo-600);
    background: var(--ws-indigo-50);
}

/* Options row */
.ws-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(16px, 2vh, 20px);
    gap: 12px;
}

.ws-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--ws-font-size-lg);
    color: var(--ws-slate-600);
    user-select: none;
}

.ws-remember input {
    display: none;
}

.ws-checkmark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--ws-slate-300);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ws-transition);
}

.ws-remember input:checked + .ws-checkmark {
    background: var(--ws-indigo-500);
    border-color: var(--ws-indigo-500);
}

.ws-remember input:checked + .ws-checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ws-forgot-link {
    font-size: var(--ws-font-size-lg);
    color: var(--ws-indigo-600);
    font-weight: 600;
    transition: var(--ws-transition);
}

.ws-forgot-link:hover {
    color: var(--ws-indigo-700);
    text-decoration: underline;
}

/* Submit button */
.ws-login-submit {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--ws-radius-md);
    border: none;
    background: linear-gradient(135deg, var(--ws-indigo-600) 0%, var(--ws-indigo-500) 50%, var(--ws-emerald-500) 100%);
    background-size: 200% auto;
    color: #fff;
    font-size: var(--ws-font-size-lg);
    font-weight: 700;
    cursor: pointer;
    transition: var(--ws-transition);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ws-login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    background-position: right center;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35);
}

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

.ws-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: clamp(16px, 2vh, 20px) 0 0;
    font-size: var(--ws-font-size);
    color: var(--ws-slate-400);
}

.ws-login-divider::before,
.ws-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ws-slate-200);
}

.ws-login-footer-note {
    margin: 12px 0 0;
    text-align: center;
    font-size: var(--ws-font-size);
    color: var(--ws-slate-400);
    line-height: 1.4;
}

.ws-login-redtech {
    margin: 6px 0 0;
    text-align: center;
    font-size: var(--ws-font-size);
    font-weight: 600;
    color: var(--ws-slate-500);
}

.ws-login-redtech-version {
    color: var(--ws-slate-400);
    font-weight: 600;
}

.ws-login-redtech a {
    color: var(--ws-indigo-600);
    font-weight: 700;
    text-decoration: none;
}

.ws-login-redtech a:hover {
    text-decoration: underline;
}

/* Short viewports — hide decorative blocks so larger dashboard typography still fits */
@media (max-height: 1000px) {
    .ws-login-visual {
        display: none;
    }
}

@media (max-height: 780px) {
    .ws-login-trust {
        display: none;
    }

    .ws-login-hero-copy p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (max-height: 700px) {
    .ws-login-divider {
        display: none;
    }

    .ws-login-features {
        gap: 8px;
    }

    .ws-login-features li {
        font-size: var(--ws-font-size);
    }

    .ws-login-card {
        padding-top: 22px;
        padding-bottom: 18px;
    }
}

/* Responsive */
@media (max-width: 992px) {
    body.ws-login-page {
        overflow-y: auto;
        max-height: none;
    }

    .ws-login-shell {
        grid-template-columns: 1fr;
        padding: 20px;
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }

    .ws-login-illustration {
        display: none;
    }

    .ws-login-mobile-brand {
        display: flex;
    }

    .ws-login-main {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ws-login-main {
        padding: 12px;
    }

    .ws-login-card {
        padding: 32px 22px 24px;
    }

    .ws-login-options {
        flex-direction: column;
        align-items: flex-start;
    }
}
