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

:root {
    --bg: #0d1117;
    --card: #111827;
    --accent: #4ade80;
    --acc-dim: rgba(74, 222, 128, .12);
    --border: rgba(255, 255, 255, .07);
    --border-g: rgba(74, 222, 128, .2);
    --text: #e2e8f0;
    --muted: #4b5a6e;
}

body {
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Grid texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Radial glow */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(74, 222, 128, .04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    display: flex;
    width: 640px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-g);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, .05), 0 0 40px rgba(74, 222, 128, .08), 0 24px 60px rgba(0, 0, 0, .6);
    animation: card-appear .5s cubic-bezier(.22, 1, .36, 1) forwards;
    opacity: 0;
    transform: scale(.97) translateY(10px);
}

@keyframes card-appear {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* LEFT side — form */
.card-left {
    width: 55%;
    background: linear-gradient(160deg, #131d2e 0%, #0d1117 100%);
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.card-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 60%, rgba(74, 222, 128, .04) 0%, transparent 60%);
    pointer-events: none;
}

.form-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -.3px;
}

.form-subtitle {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 22px;
}

.error-msg {
    background: rgba(248, 113, 113, .08);
    border: 1px solid rgba(248, 113, 113, .25);
    color: #fca5a5;
    font-size: .78rem;
    padding: 8px 12px;
    border-radius: 7px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-group {
    margin-bottom: 16px;
}

.field-group label {
    display: block;
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
    margin-bottom: 6px;
}

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

.input-wrap input {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    padding: 10px 36px 10px 12px;
    outline: none;
    transition: border-color .2s, background .2s;
}

.input-wrap input:focus {
    border-color: rgba(74, 222, 128, .35);
    background: rgba(74, 222, 128, .03);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .06);
}

.input-wrap input::placeholder {
    color: #2e3a4e;
}

.input-wrap input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #131d2e inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}

.field-icon {
    position: absolute;
    right: 10px;
    color: rgba(255, 255, 255, .2);
    font-size: .85rem;
    pointer-events: none;
}

.btn-login {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    background: linear-gradient(135deg, #16a34a, #052e16);
    border: 1px solid rgba(74, 222, 128, .35);
    border-radius: 8px;
    color: var(--accent);
    font-family: 'Space Grotesk', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 0 20px rgba(74, 222, 128, .12);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(74, 222, 128, .22);
    background: linear-gradient(135deg, #15803d, #052e16);
}

.btn-login:active {
    transform: translateY(0);
}

.signup-link {
    text-align: center;
    margin-top: 14px;
    font-size: .78rem;
    color: var(--muted);
}

.signup-link a {
    color: var(--accent);
    font-weight: 600;
}

.signup-link a:hover {
    opacity: .8;
}

/* RIGHT side — welcome */
.card-right {
    width: 45%;
    background: linear-gradient(160deg, #0b1a10 0%, #0d1117 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(74, 222, 128, .1);
}

.card-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(74, 222, 128, .07) 0%, transparent 65%);
    pointer-events: none;
}

/* Animated grid on right */
.card-right::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(74, 222, 128, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 222, 128, .04) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
}

.welcome-logo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 1px solid rgba(74, 222, 128, .3);
    box-shadow: 0 0 24px rgba(74, 222, 128, .2);
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {

    0%,
    100% {
        box-shadow: 0 0 16px rgba(74, 222, 128, .15);
    }

    50% {
        box-shadow: 0 0 32px rgba(74, 222, 128, .35);
    }
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.welcome-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: .5px;
}

.welcome-title span {
    color: var(--accent);
}

.welcome-sub {
    margin-top: 10px;
    font-size: .7rem;
    color: rgba(74, 222, 128, .5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Decorative corner */
.slash-deco {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 160px;
    background: rgba(74, 222, 128, .03);
    transform: rotate(-18deg);
    border-radius: 6px;
}

@media(max-width:640px) {
    .login-card {
        flex-direction: column;
        width: 100%;
        max-width: 360px;
    }

    .card-left,
    .card-right {
        width: 100%;
    }

    .card-right {
        min-height: 150px;
    }

    .slash-deco {
        display: none;
    }
}