:root {
    --auth-ink: #141327;
    --auth-muted: #75688f;
    --auth-line: #d7ccee;
    --auth-primary: #5a34a1;
    --auth-primary-hover: #4c2a92;
    --auth-primary-active: #402078;
    --auth-left-bg: #f5efff;
    --auth-right-bg-a: #7b57cb;
    --auth-right-bg-b: #5a34a1;
    --auth-right-bg-c: #402078;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background: #ede6ff;
}

.auth-wrap {
    min-height: 100vh;
}

.auth-panel {
    min-height: 100vh;
}

.auth-panel--split {
    display: grid;
    grid-template-columns: 1.04fr 1fr;
}

.auth-side {
    min-height: 100vh;
}

.auth-side--form {
    background: var(--auth-left-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem 1.5rem;
    order: 1;
}

.auth-form-wrap {
    width: min(420px, 100%);
}

.brand-row {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.brand-logo {
    width: 188px;
    height: auto;
    display: block;
}

.auth-header h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #1f1242;
}

.auth-header p {
    margin: 0 0 1.9rem;
    color: var(--auth-muted);
    font-size: 1.1rem;
}

.form-label {
    font-weight: 600;
    color: #24174a;
    margin-bottom: 0.45rem;
}

.form-control {
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid var(--auth-line);
    background: #ffffff;
    padding: 0.68rem 0.78rem;
    color: #11111b;
}

.form-control:focus {
    border-color: #a998dd;
    box-shadow: 0 0 0 0.24rem rgba(98, 72, 180, 0.14);
}

.password-shell {
    position: relative;
}

.password-shell .form-control {
    padding-right: 86px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #5d5387;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.25rem 0.45rem;
}

.toggle-password:hover,
.toggle-password:focus {
    color: #3d3562;
}

.password-group .form-control {
    border-right: 0;
}

.password-group .toggle-password {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    min-width: 48px;
    border: 1px solid var(--auth-line);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.65rem;
}

.password-group .toggle-password:hover,
.password-group .toggle-password:focus {
    background: #f4f0ff;
}

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

.auth-options {
    margin-top: 0.8rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.remember-check {
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    color: #1d1a32;
    font-size: 0.98rem;
}

.remember-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
}

.remember-link {
    text-decoration: none;
    color: #5b46a2;
    font-weight: 700;
}

.remember-link:hover,
.remember-link:focus {
    color: #452f8f;
    text-decoration: underline;
}

.btn-primary {
    --bs-btn-bg: var(--auth-primary);
    --bs-btn-border-color: var(--auth-primary);
    --bs-btn-hover-bg: var(--auth-primary-hover);
    --bs-btn-hover-border-color: var(--auth-primary-hover);
    --bs-btn-active-bg: var(--auth-primary-active);
    --bs-btn-active-border-color: var(--auth-primary-active);
    --bs-btn-disabled-bg: var(--auth-primary);
    --bs-btn-disabled-border-color: var(--auth-primary);
    --bs-btn-focus-shadow-rgb: 90, 52, 161;
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    border-radius: 7px;
    min-height: 48px;
    font-weight: 700;
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
    box-shadow: 0 0 0 0.24rem rgba(90, 52, 161, 0.2);
}

.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.show > .btn-primary.dropdown-toggle {
    background: var(--auth-primary-active);
    border-color: var(--auth-primary-active);
    box-shadow: 0 0 0 0.24rem rgba(90, 52, 161, 0.22);
}

.auth-footnote {
    margin: 1.3rem 0 0;
    color: #838096;
    text-align: center;
    font-size: 0.9rem;
}

.auth-side--visual {
    background: linear-gradient(
        145deg,
        var(--auth-right-bg-a) 0%,
        var(--auth-right-bg-b) 48%,
        var(--auth-right-bg-c) 100%
    );
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    order: 2;
}

.auth-side--visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.21), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 82% 88%, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.visual-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    transform: translate(-10%, 2%);
    pointer-events: none;
}

.visual-icons {
    position: absolute;
    inset: 14% 8% auto;
    height: 145px;
    pointer-events: none;
}

.visual-icons span {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
}

.visual-icons span:nth-child(1) {
    width: 62px;
    height: 62px;
    left: 8%;
    top: 10%;
}

.visual-icons span:nth-child(2) {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    left: 43%;
    top: 16%;
}

.visual-icons span:nth-child(3) {
    width: 86px;
    height: 48px;
    border-radius: 12px;
    right: 18%;
    top: 22%;
}

.visual-icons span:nth-child(4) {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    right: 5%;
    top: 2%;
}

.visual-illustration {
    width: min(86%, 560px);
    height: auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 28px 50px rgba(33, 20, 69, 0.35));
    animation: visualFloat 5.6s ease-in-out infinite;
}

.visual-dots {
    position: absolute;
    right: 10%;
    top: 52%;
    display: inline-flex;
    gap: 0.56rem;
}

.visual-dots i {
    width: 15px;
    height: 15px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: inline-flex;
}

.visual-dots i:first-child {
    background: rgba(255, 255, 255, 0.36);
}

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

.modal-content {
    border-radius: 18px;
    border: 1px solid rgba(20, 19, 39, 0.1);
    box-shadow: 0 24px 50px rgba(20, 19, 39, 0.2);
}

.modal-header,
.modal-footer {
    border: none;
}

.modal-header {
    padding: 1.25rem 1.25rem 0.6rem;
}

.modal-body {
    padding: 0.8rem 1.25rem;
}

.modal-footer {
    padding: 0.6rem 1.25rem 1.2rem;
}

@media (max-width: 1080px) {
    .auth-panel--split {
        grid-template-columns: 1fr;
    }

    .auth-side--visual {
        min-height: 340px;
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .auth-side--form {
        padding: 1.5rem 1rem;
    }

    .auth-header h1 {
        font-size: 2rem;
    }

    .auth-header p {
        font-size: 0.96rem;
    }

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

    .auth-side--visual {
        display: none;
    }
}
