* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2D1B69 0%, #11998E 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 70%, transparent 100%);
    animation: float-around 20s infinite linear;
}

.orb-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: -100px;
    animation-duration: 25s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: -75px;
    animation-duration: 30s;
    animation-direction: reverse;
}

.orb-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-duration: 35s;
}

@keyframes float-around {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, -50px) rotate(90deg);
    }
    50% {
        transform: translate(50px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

.container {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.form-container {

    padding: 30px 20px;
    position: relative;
    min-height: 800px;
}

.form-toggle {
    display: flex;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 6px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toggle-btn {
    flex: 1;
    padding: 14px 24px;
    text-align: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.toggle-btn.active {
    color: #2D1B69;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

.form-title {
    text-align: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.form-section {
    position: relative;
    width: 100%;
    height: 100%;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.form-group:nth-child(2) {
    animation-delay: 0.1s;
}
.form-group:nth-child(3) {
    animation-delay: 0.2s;
}
.form-group:nth-child(4) {
    animation-delay: 0.3s;
}
.form-group:nth-child(5) {
    animation-delay: 0.4s;
}
.form-group:nth-child(6) {
    animation-delay: 0.5s;
}
.form-group:nth-child(7) {
    animation-delay: 0.6s;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.form-input:valid {
    border-color: rgba(76, 175, 80, 0.6);
}

.form-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2D1B69 0%, #11998E 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(45, 27, 105, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.form-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.form-btn:hover::before {
    left: 100%;
}

.form-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(45, 27, 105, 0.6);
    background: linear-gradient(135deg, #3D2B79 0%, #21A09E 100%);
}

.form-btn:active {
    transform: translateY(-1px);
}

.form-footer {
    text-align: center;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
}

.form-footer a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-footer a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    display: inline-block;
}

/* Form switching animations */
.login-form, .signup-form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 40px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-form {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.signup-form {
    opacity: 0;
    transform: translateX(100%);
    z-index: 1;
}

.signup-form.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.login-form.inactive {
    opacity: 0;
    transform: translateX(-100%);
    z-index: 1;
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: white;
    transform: translateY(-50%) scale(1.1);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 100%;
        border-radius: 20px;
    }

    .form-container {
        overflow-y: auto;
        padding: 30px 25px;
        min-height: 620px;
    }

    .login-form, .signup-form {
        padding: 0 25px;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-input {
        padding: 14px 18px;
        font-size: 15px;
    }

    .form-btn {
        padding: 16px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .form-container {
        padding: 25px 20px;
    }

    .login-form, .signup-form {
        padding: 0 20px;
    }
}

/* Loading animation for better UX */
.form-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.form-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Success animation */
.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    margin: 20px auto;
    position: relative;
    transform: scale(0);
    animation: scale-up 0.3s ease-out forwards;
}

.success-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
}

@keyframes scale-up {
    to {
        transform: scale(1);
    }
}