* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: #eef1f8;
    -webkit-font-smoothing: antialiased;
}

.login-page {
    display: flex;
    min-height: 100vh;
}

/* ---- Branding side ---- */
.login-side {
    flex: 1 1 48%;
    background: linear-gradient(155deg, #0a1638 0%, #101f52 38%, #1a3aa8 75%, #2352d6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 3rem 4rem 3rem 3rem;
    position: relative;
    overflow: hidden;
}

.login-side-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.login-side-glow-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0) 72%);
    top: -220px;
    right: -180px;
    animation: login-drift 12s ease-in-out infinite;
}

.login-side-glow-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
    bottom: -160px;
    left: -120px;
    animation: login-drift 14s ease-in-out infinite reverse;
}

@keyframes login-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -18px) scale(1.06); }
}

.login-side-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0) 75%);
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0) 75%);
    pointer-events: none;
}

.login-side-content {
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.login-logo-card {
    display: inline-flex;
    background: #fff;
    border-radius: 14px;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.6);
}

.login-logo-img {
    display: block;
    height: 74px;
    width: auto;
}

.login-tagline {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    margin-bottom: 2rem;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.75rem;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
    padding: 0.55rem 0.75rem;
    border-radius: 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
}

.login-features i {
    color: #7dd3fc;
    font-size: 1rem;
    flex-shrink: 0;
}

.login-contact {
    border-top: 1px solid rgba(255,255,255,0.16);
    padding-top: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255,255,255,0.78);
}

.login-contact i {
    width: 18px;
    margin-right: 0.45rem;
    color: rgba(255,255,255,0.55);
}

/* ---- Form side ---- */
.login-main {
    flex: 1 1 52%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    position: relative;
}

.login-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    margin-left: -70px;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.28), 0 8px 20px -6px rgba(15, 23, 42, 0.1);
    padding: 2.75rem 2.5rem 2rem;
    animation: login-card-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2.5rem;
    right: 2.5rem;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

@keyframes login-card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.9rem;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.35);
}

.login-card-heading {
    margin-bottom: 1.85rem;
}

.login-card-heading h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.login-card-heading p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0.35rem 0 0;
}

.form-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.login-card .form-control {
    background: #f8fafc;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
    padding: 0.68rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.login-card .form-control:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.login-card .form-control::placeholder {
    color: #a3adc2;
}

.input-icon-group {
    position: relative;
}

.input-icon-group .form-control {
    padding-left: 2.6rem;
}

.input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.input-icon-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.input-icon-toggle:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.input-icon-group:has(.input-icon-toggle) .form-control {
    padding-right: 2.5rem;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.captcha-img {
    border-radius: 0.5rem;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    height: 50px;
    flex-shrink: 0;
}

.captcha-refresh {
    font-size: 1.25rem;
    color: #2563eb;
    text-decoration: none;
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.captcha-refresh:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
}

.captcha-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    border: none;
    border-radius: 0.6rem;
    padding: 0.72rem 1rem;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    margin-top: 0.35rem;
    box-shadow: 0 10px 24px -8px rgba(29, 78, 216, 0.55);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 55%, #2563eb 100%);
    box-shadow: 0 14px 28px -8px rgba(29, 78, 216, 0.6);
    transform: translateY(-1px);
}

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

.login-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.15rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

.login-trust i {
    color: #22c55e;
    font-size: 0.8rem;
}

.login-card .alert-danger {
    border: none;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 0.55rem;
    font-size: 0.87rem;
    font-weight: 500;
}

.login-footer {
    text-align: center;
    color: #a1a9b8;
    font-size: 0.78rem;
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Stack to a single column on narrow screens; branding panel collapses to a compact banner */
@media (max-width: 900px) {
    .login-page {
        flex-direction: column;
    }

    .login-side {
        flex: 0 0 auto;
        padding: 2rem 1.5rem;
    }

    .login-features,
    .login-tagline {
        display: none;
    }

    .login-contact {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        border-top: none;
        padding-top: 0;
    }

    .login-main {
        padding: 2rem 1.5rem 3rem;
    }

    .login-card {
        margin-left: 0;
        margin-top: -2.5rem;
    }
}
