@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Inter",
        -apple-system,
        sans-serif;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            2px 2px at 20% 30%,
            rgba(255, 255, 255, 0.3),
            transparent
        ),
        radial-gradient(
            2px 2px at 40% 70%,
            rgba(255, 255, 255, 0.2),
            transparent
        ),
        radial-gradient(
            2px 2px at 60% 20%,
            rgba(255, 255, 255, 0.3),
            transparent
        ),
        radial-gradient(
            2px 2px at 80% 80%,
            rgba(255, 255, 255, 0.2),
            transparent
        ),
        radial-gradient(
            1px 1px at 10% 90%,
            rgba(255, 255, 255, 0.4),
            transparent
        ),
        radial-gradient(
            1px 1px at 90% 10%,
            rgba(255, 255, 255, 0.4),
            transparent
        );
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 0;
    animation: particlesFloat 20s linear infinite;
}

@keyframes particlesFloat {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50px, -50px);
    }
}

body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(
            ellipse at 20% 50%,
            rgba(99, 102, 241, 0.08),
            transparent 50%
        ),
        radial-gradient(
            ellipse at 80% 50%,
            rgba(129, 140, 248, 0.08),
            transparent 50%
        );
    pointer-events: none;
    z-index: 0;
    animation: orbPulse 8s ease-in-out infinite;
}

@keyframes orbPulse {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
}

.login-container {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    min-height: 480px;
    z-index: 1;
}

.login-brand {
    background: linear-gradient(160deg, #0f172a, #1e1b4b, #312e81);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 30% 20%,
            rgba(99, 102, 241, 0.2),
            transparent 60%
        ),
        radial-gradient(
            ellipse at 70% 80%,
            rgba(129, 140, 248, 0.15),
            transparent 50%
        );
}

.login-brand .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbFloat 6s ease-in-out infinite;
}

.login-brand .orb:nth-child(1) {
    width: 250px;
    height: 250px;
    background: #818cf8;
    top: -80px;
    right: -60px;
}

.login-brand .orb:nth-child(2) {
    width: 150px;
    height: 150px;
    background: #6366f1;
    bottom: -40px;
    left: -40px;
    animation-delay: 3s;
}

@keyframes orbFloat {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-10px, -10px) scale(1.1);
    }
}

.brand-content {
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}
.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 60%, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text span {
    -webkit-text-fill-color: #818cf8;
}

.tagline {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
}

.features {
    display: grid;
    gap: 6px;
}
.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s;
}
.feature:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}
.feature .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #818cf8;
    flex-shrink: 0;
    opacity: 0.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 36px;
    background: #f8fafc;
}

.form-header {
    margin-bottom: 28px;
}
.form-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}
.form-header p {
    color: #64748b;
    font-size: 13px;
}

.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field .wrap {
    position: relative;
}
.field .wrap .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}
.field input {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.3s;
    background: #fff;
    color: #0f172a;
}
.field input:focus {
    outline: 0;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.field input::placeholder {
    color: #94a3b8;
    font-size: 12px;
}
.field input.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}
.field input.is-valid {
    border-color: #22c55e;
    background: #f0fdf4;
}
.field .error {
    color: #ef4444;
    font-size: 11px;
    margin-top: 4px;
    display: none;
}
.field .error.show {
    display: block;
}
.field .toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: 0;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.3s;
}
.field .toggle:hover {
    color: #6366f1;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.options .remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}
.options .remember input {
    width: 14px;
    height: 14px;
    accent-color: #6366f1;
    cursor: pointer;
}
.options .forgot {
    color: #94a3b8;
    text-decoration: 0;
    font-size: 12px;
    transition: color 0.3s;
}
.options .forgot:hover {
    color: #6366f1;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(99, 102, 241, 0.4);
}
.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-login.loading .text {
    visibility: hidden;
}
.btn-login.loading::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.social {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.social button {
    width: 38px;
    height: 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: #334155;
}
.social button:hover {
    border-color: #6366f1;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
}

.invalid-feedback,
.invalid-feedback.d-block {
    display: none !important;
}

@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 400px;
        min-height: auto;
    }
    .login-brand {
        padding: 30px 24px;
        min-height: 140px;
    }
    .login-brand .features {
        display: none;
    }
    .login-form {
        padding: 30px 24px;
        background: #f8fafc;
    }
    .logo-text {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 8px;
    }
    .login-container {
        border-radius: 16px;
    }
    .login-brand {
        padding: 24px 18px;
        min-height: 120px;
    }
    .login-form {
        padding: 24px 18px;
    }
    .logo-text {
        font-size: 17px;
    }
    .logo-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .form-header h2 {
        font-size: 20px;
    }
    .field input {
        padding: 9px 10px 9px 34px;
        font-size: 12px;
        border-radius: 8px;
    }
    .btn-login {
        padding: 10px;
        font-size: 13px;
        border-radius: 8px;
        min-height: 42px;
    }
    .social button {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .login-form {
        padding: 18px 14px;
    }
    .login-brand {
        padding: 18px 14px;
        min-height: 100px;
    }
    .logo-text {
        font-size: 15px;
    }
    .options {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
