:root {
    --login-purple: #6d39c9;
    --login-purple-deep: #5b2db0;
    --login-purple-soft: #8b6dd4;
    --login-ink: #111827;
    --login-muted: #6b7280;
    --login-border: #e5e7eb;
    --login-font: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body.login-body {
    font-family: var(--login-font);
    color: var(--login-ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* —— Left form —— */
.login-form-side {
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem 2rem;
    background: #fff;
    min-height: 0;
    overflow: hidden;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--login-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    align-self: flex-start;
}

.login-logo__mark {
    width: 28px;
    height: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.login-logo__mark span {
    border-radius: 3px;
    background: var(--login-purple);
}

.login-logo__mark span:nth-child(2) {
    background: #c4b5fd;
    transform: translate(1px, -1px);
}

.login-logo__mark span:nth-child(3) { background: #7c3aed; }
.login-logo__mark span:nth-child(4) { background: #a78bfa; }

.login-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-header h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.login-header p {
    margin: 0;
    font-size: 0.98rem;
    color: var(--login-muted);
}

.login-alert {
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.login-alert--success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.login-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-field {
    margin-bottom: 1.1rem;
}

.login-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.45rem;
}

.login-field input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    padding: 0 0.95rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--login-ink);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input::placeholder { color: #9ca3af; }

.login-field input:focus {
    outline: none;
    border-color: var(--login-purple-soft);
    box-shadow: 0 0 0 3px rgba(109, 57, 201, 0.12);
}

.login-field input.is-invalid {
    border-color: #f87171;
}

.login-field__error {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.login-password-wrap {
    position: relative;
}

.login-password-wrap input {
    padding-right: 2.75rem;
}

.login-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-password-toggle:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.15rem 0 1.35rem;
}

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.login-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--login-purple);
    cursor: pointer;
}

.login-link {
    color: var(--login-purple);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-link:hover { color: var(--login-purple-deep); }

.login-submit {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: var(--login-purple);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.login-submit:hover {
    background: var(--login-purple-deep);
}

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

.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.92rem;
    color: var(--login-muted);
}

.login-footer a {
    color: var(--login-purple);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-footer a:hover { color: var(--login-purple-deep); }

/* —— Right visual —— */
.login-visual {
    position: relative;
    background: linear-gradient(155deg, #6d39c9 0%, #7b5cc8 45%, #8b6fd4 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 2rem;
}

.login-visual__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-visual__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
}

.login-visual__orb--1 {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -60px;
    background: rgba(255, 255, 255, 0.28);
}

.login-visual__orb--2 {
    width: 220px;
    height: 220px;
    bottom: 8%;
    left: -70px;
    background: rgba(167, 139, 250, 0.55);
}

.login-visual__orb--3 {
    width: 160px;
    height: 160px;
    top: 42%;
    right: 8%;
    background: rgba(196, 181, 253, 0.4);
}

.login-visual__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.1px, transparent 1.1px);
    background-size: 22px 22px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 10%, transparent 75%);
}

.login-float {
    position: absolute;
    width: 28px;
    height: 28px;
    stroke: rgba(255, 255, 255, 0.7);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
    animation: loginFloat 7s ease-in-out infinite;
}

.login-float--1 { top: 12%; left: 14%; width: 30px; height: 30px; animation-delay: 0s; }
.login-float--2 { top: 18%; right: 16%; width: 26px; height: 26px; animation-delay: 0.8s; }
.login-float--3 { top: 38%; left: 8%; width: 28px; height: 28px; animation-delay: 1.4s; }
.login-float--4 { top: 28%; right: 10%; width: 26px; height: 26px; animation-delay: 0.4s; }
.login-float--5 { bottom: 28%; left: 12%; width: 28px; height: 28px; animation-delay: 1.1s; }
.login-float--6 { bottom: 22%; right: 14%; width: 30px; height: 30px; animation-delay: 1.8s; }
.login-float--7 { top: 48%; right: 22%; width: 24px; height: 24px; animation-delay: 0.6s; }

.login-float--x1,
.login-float--x2,
.login-float--x3 {
    width: auto;
    height: auto;
    stroke: none;
    fill: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1;
}

.login-float--x1 { top: 22%; left: 28%; animation-delay: 0.2s; }
.login-float--x2 { top: 58%; left: 18%; animation-delay: 1.5s; }
.login-float--x3 { bottom: 18%; right: 28%; animation-delay: 0.9s; }

@keyframes loginFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-visual__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 460px;
    max-height: 82%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.login-visual__img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    filter: drop-shadow(0 18px 30px rgba(40, 20, 80, 0.28));
}

@media (max-width: 960px) {
    body.login-body {
        height: auto;
        overflow: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .login-visual {
        min-height: 280px;
        order: -1;
        padding: 1.25rem;
    }

    .login-visual__inner {
        max-height: 100%;
    }

    .login-form-side {
        padding: 1.5rem 1.35rem 2.25rem;
        overflow: visible;
    }

    .login-form-wrap {
        max-width: 420px;
        flex: none;
        padding: 1.25rem 0 0;
    }
}

@media (max-width: 480px) {
    .login-visual { min-height: 220px; }
    .login-header h1 { font-size: 1.55rem; }
}
