@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;
    background: #f8fafc;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* Main Container */
.login-container {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 25px 80px rgba(15, 23, 42, .08);
    overflow: hidden;
    min-height: 600px;
    position: relative;
}

/* Brand Side */
.login-brand {
    background: linear-gradient(160deg, #0f172a, #1e1b4b, #312e81);
    padding: 56px 48px;
    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, .15), transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(129, 140, 248, .08), transparent 50%);
}

.login-brand::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, .03), transparent 70%);
    border-radius: 50%;
}

.login-brand .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .15;
}

.login-brand .orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: #818cf8;
    top: -100px;
    right: -80px;
}

.login-brand .orb:nth-child(2) {
    width: 200px;
    height: 200px;
    background: #6366f1;
    bottom: -60px;
    left: -60px;
}

.brand-content {
    position: relative;
    z-index: 2;
}

.login-brand .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.login-brand .logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .08);
    letter-spacing: -.5px;
}

.login-brand .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.5px;
    background: linear-gradient(135deg, #fff 60%, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-brand .logo-text span {
    -webkit-text-fill-color: #818cf8;
}

.login-brand .tagline {
    color: rgba(255, 255, 255, .4);
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 40px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.login-brand .features {
    display: grid;
    gap: 10px;
}

.login-brand .feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    font-weight: 400;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .04);
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    cursor: default;
}

.login-brand .feature:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .08);
    transform: translateX(6px);
}

.login-brand .feature .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
    flex-shrink: 0;
    opacity: .6;
}

/* Form Side */
.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 48px;
    background: #fff;
}

.form-header {
    margin-bottom: 36px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -.7px;
}

.form-header p {
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.field .wrap {
    position: relative;
}

.field .wrap .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    transition: color .3s;
}

.field input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 400;
    transition: all .3s;
    background: #fafbfc;
    color: #0f172a;
    font-family: inherit;
}

.field input:focus {
    outline: 0;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .08);
}

.field input:hover {
    border-color: #94a3b8;
    background: #fff;
}

.field input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.field input.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.field input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .08);
}

.field input.is-valid {
    border-color: #22c55e;
    background: #f0fdf4;
}

.field input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .08);
}

.field .error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.field .error.show {
    display: block;
}

.field .toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: 0;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color .3s;
    display: grid;
    place-items: center;
}

.field .toggle:hover {
    color: #6366f1;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.options .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-weight: 500;
}

.options .remember input {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
    border-radius: 4px;
}

.options .forgot {
    color: #94a3b8;
    text-decoration: 0;
    font-size: 13px;
    font-weight: 500;
    transition: color .3s;
}

.options .forgot:hover {
    color: #6366f1;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #312e81);
    color: #fff;
    border: 0;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    font-family: inherit;
    letter-spacing: .2px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(30, 27, 75, .3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-login.loading {
    pointer-events: none;
    opacity: .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, .2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.social {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.social button {
    width: 44px;
    height: 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all .3s;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: #334155;
    font-weight: 600;
}

.social button:hover {
    border-color: #6366f1;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .1);
}

.invalid-feedback,
.invalid-feedback.d-block {
    display: none !important;
}

/* Responsive */
@media(max-width:992px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 440px;
        border-radius: 28px;
        min-height: auto;
    }
    .login-brand {
        padding: 36px 28px;
        min-height: 180px;
    }
    .login-brand .logo-text {
        font-size: 22px;
    }
    .login-brand .features {
        display: none;
    }
    .login-form {
        padding: 36px 28px;
    }
}

@media(max-width:576px) {
    body {
        padding: 12px;
    }
    .login-form {
        padding: 28px 20px;
    }
    .login-brand {
        padding: 28px 20px;
        min-height: 150px;
    }
    .login-brand .logo-text {
        font-size: 20px;
    }
    .login-brand .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .form-header h2 {
        font-size: 22px;
    }
    .field input {
        padding: 11px 14px 11px 40px;
        font-size: 13px;
        border-radius: 12px;
    }
    .login-container {
        border-radius: 20px;
    }
    .social button {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    .btn-login {
        padding: 13px;
        font-size: 14px;
        border-radius: 12px;
    }
}

@media(max-width:400px) {
    .login-form {
        padding: 20px 16px;
    }
    .options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .login-brand {
        padding: 20px 16px;
        min-height: 120px;
    }
    .login-brand .logo-text {
        font-size: 17px;
    }
}

/* Dark Mode */
@media(prefers-color-scheme:dark) {
    body {
        background: #0f0a1a;
    }
    .login-container {
        background: #1a1a2e;
    }
    .login-form {
        background: #1a1a2e;
    }
    .form-header h2 {
        color: #fff;
    }
    .form-header p {
        color: #94a3b8;
    }
    .field label {
        color: #c4b5d4;
    }
    .field input {
        background: #2d2a4a;
        border-color: #4c3d7a;
        color: #fff;
    }
    .field input:focus {
        border-color: #818cf8;
        background: #2d2a4a;
        box-shadow: 0 0 0 4px rgba(129, 140, 248, .1);
    }
    .field input::placeholder {
        color: #7c6ba0;
    }
    .options .remember {
        color: #c4b5d4;
    }
    .options .forgot {
        color: #94a3b8;
    }
    .btn-login {
        background: linear-gradient(135deg, #4c3d7a, #4338ca, #6366f1);
    }
    .btn-login:hover:not(:disabled) {
        box-shadow: 0 16px 48px rgba(67, 56, 202, .4);
    }
    .social button {
        border-color: #4c3d7a;
        background: #2d2a4a;
        color: #c4b5d4;
    }
    .social button:hover {
        border-color: #818cf8;
        background: #2d2a4a;
    }
    .divider {
        color: #7c6ba0;
    }
    .divider::before,
    .divider::after {
        background: #4c3d7a;
    }
    .field .error {
        color: #f87171;
    }
    .field input.is-invalid {
        background: #2d1a1a;
        border-color: #ef4444;
    }
    .field input.is-valid {
        background: #1a2d1a;
        border-color: #22c55e;
    }
    .field .toggle:hover {
        color: #818cf8;
    }
}