html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(145deg, #0B1120 0%, #19233C 100%);
    background-attachment: fixed;
    background-size: cover;
    overflow: hidden;
    /* prevents scrollbars */
    position: relative;
}

/* glowing orbs */
body::before,
body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25) 0%, rgba(139, 92, 246, 0) 70%);
    top: 10%;
    left: 0;
    /* keep inside viewport */
    animation: floatGlow 15s infinite alternate ease-in-out;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0) 70%);
    bottom: 0;
    /* keep inside viewport */
    right: 0;
    animation: floatGlow 18s infinite alternate-reverse ease-in-out;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.9;
    }
}

/* glassmorphic card container */
.login-card {
    background: rgba(18, 25, 45, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 460px;
    margin: 1.5rem auto;
    z-index: 1;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 50px -18px rgba(0, 0, 0, 0.5);
}

.card-inner {
    padding: 2rem 1.8rem 2.2rem 1.8rem;
}

/* custom logo */
.custom-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.custom-logo img {
    max-width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.2rem;
    padding: 0.5rem 0.8rem;
    backdrop-filter: blur(2px);
    transition: all 0.2s ease;
}

.custom-logo img:hover {
    background: rgba(255, 255, 255, 0.08);
}

h2 {
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: -0.3px;
    background: linear-gradient(120deg, #FFFFFF, #C7D2FE);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.welcome-sub {
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.8rem;
    border-left: 3px solid #4F46E5;
    padding-left: 0.75rem;
}

/* modern input groups */
.input-group-custom {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 1rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
}

.input-group-custom:focus-within {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

.input-icon {
    background: transparent;
    border: none;
    color: #9CA3AF;
    padding-left: 1rem;
    padding-right: 0.25rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.form-control-modern {
    background: transparent;
    border: none;
    padding: 0.85rem 0.75rem 0.85rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #F3F4F6;
    outline: none;
    box-shadow: none;
}

.form-control-modern:focus {
    background: transparent;
    box-shadow: none;
    color: white;
}

.form-control-modern::placeholder {
    color: #6B7280;
    font-weight: 400;
    font-size: 0.9rem;
}

.form-control-modern,
.form-control-modern:focus,
.form-control-modern:active,
.form-control-modern:-webkit-autofill,
.form-control-modern:-webkit-autofill:hover,
.form-control-modern:-webkit-autofill:focus {
    background: transparent !important;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    box-shadow: 0 0 0px 1000px transparent inset !important;
    color: #F3F4F6 !important;
}

.password-toggle {
    background: transparent;
    border: none;
    color: #9CA3AF;
    padding-right: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #C7D2FE;
}

.form-check-label {
    font-size: 0.85rem;
    color: #CBD5E1;
    cursor: pointer;
}

.form-check-input {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: #4B5563;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #4F46E5;
    border-color: #4F46E5;
}

.forgot-link {
    font-size: 0.85rem;
    color: #A5B4FC;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #C7D2FE;
    text-decoration: underline;
}

.btn-gradient {
    background: linear-gradient(95deg, #4F46E5, #06B6D4);
    border: none;
    padding: 0.85rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 1rem;
    color: white;
    transition: all 0.25s ease;
    box-shadow: 0 8px 18px -6px rgba(79, 70, 229, 0.4);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    background: linear-gradient(95deg, #6366F1, #14B8A6);
    box-shadow: 0 12px 22px -8px rgba(79, 70, 229, 0.6);
}

.btn-gradient:active {
    transform: translateY(1px);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6B7280;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 1.5rem 0 1rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
    margin: 0 0.8rem;
}

.social-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.65rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: #E2E8F0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-btn:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: #4F46E5;
    color: white;
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 1.2rem;
}

.signup-link {
    text-align: center;
    margin-top: 1.6rem;
    font-size: 0.85rem;
    color: #9CA3AF;
}

.signup-link a {
    color: #A5B4FC;
    font-weight: 600;
    text-decoration: none;
}

.signup-link a:hover {
    text-decoration: underline;
    color: #C7D2FE;
}

/* Django error message styling */
.alert-django {
    margin-bottom: 1.25rem;
    border-radius: 1rem;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FECACA;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .card-inner {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.6rem;
    }
}