/* ===== Base Reset & Typography ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

/* ===== Main Container ===== */
.main {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1145 30%, #0d1b3e 60%, #0a0e27 100%);
    position: relative;
    overflow: hidden;
}

/* ===== Animated Background Orbs ===== */
.main::before,
.main::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 8s ease-in-out infinite;
}

.main::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.main::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent);
    bottom: -80px;
    left: -80px;
    animation-delay: 4s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

/* ===== Glassmorphism Form Card ===== */
.form {
    width: 420px;
    max-width: 95vw;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(99, 102, 241, 0.06) 100%
    );
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 40px 32px;
    position: relative;
    z-index: 1;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 -2px 20px rgba(99, 102, 241, 0.1) inset;
    animation: formSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes formSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Subtle shine effect on card ===== */
.form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    border-radius: 20px 20px 0 0;
}

/* ===== Logo ===== */
.logo-wrapper {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper img {
    width: 150px;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
    transition: transform 0.3s ease;
}

.logo-wrapper img:hover {
    transform: scale(1.05);
}

/* ===== Form Labels ===== */
.form-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ===== Input Groups ===== */
.input-group-custom {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px 16px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.input-group-custom:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.07);
}

.input-group-custom:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group-custom i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin-right: 12px;
    transition: color 0.3s ease;
}

.input-group-custom:focus-within i {
    color: rgba(99, 102, 241, 0.8);
}

.input-group-custom .form-control {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 12px 0;
    font-family: 'Poppins', sans-serif;
}

.input-group-custom .form-control:focus {
    outline: none;
    box-shadow: none;
}

/* ===== Password Toggle ===== */
.toggle-password {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Placeholder ===== */
input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
    font-size: 13px;
}

/* ===== Remember Me ===== */
.remember-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

.remember-check label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

/* ===== Submit Button ===== */
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, #5457e5, #7c4ff0);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Button shimmer animation */
.btn-login::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-login:hover::after {
    left: 100%;
}

/* ===== Error Messages ===== */
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeError 0.4s ease;
}

.alert-danger i {
    color: #f87171;
    font-size: 14px;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.invalid-feedback {
    color: #fca5a5;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

/* ===== Success Messages ===== */
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success i {
    color: #4ade80;
}

/* ===== Field Spacing ===== */
.form-group {
    margin-bottom: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .form {
        padding: 32px 20px;
        margin: 0 12px;
        border-radius: 16px;
    }

    .logo-wrapper img {
        width: 120px;
    }

    .btn-login {
        padding: 12px;
        font-size: 14px;
    }
}