:root {
    --primary-color: #4361ee;
    --secondary-color: #7209b7;
    --accent-color: #4cc9f0;
    --background-dark: #171923;
    --background-light: #2a2f42;
    --text-color: #f8f9fa;
    --input-background: #12151f;
    --success-color: #00c851;
    --error-color: #ff3d41;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-dark);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 15s infinite ease-in-out;
}

.circle:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.circle:nth-child(3) {
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    bottom: 100px;
    left: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-50px) translateX(50px);
    }
    50% {
        transform: translateY(20px) translateX(-30px);
    }
    75% {
        transform: translateY(40px) translateX(25px);
    }
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    background: rgba(42, 47, 66, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 10;
    transition: all 0.5s ease;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    z-index: 1;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.tab-btn {
    flex: 1;
    padding: 15px 0;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0.7;
}

.tab-btn.active {
    opacity: 1;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.tab-btn.active::after {
    width: 80%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #c2c5d1;
}

.input-field {
    width: 100%;
    padding: 15px;
    background: var(--input-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.3);
}

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

.input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(5px);
    font-size: 18px;
    color: #8d8f9a;
    cursor: pointer;
    z-index: 10;
}

.input-icon:hover {
    color: var(--text-color);
}

.btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    z-index: -1;
    transition: opacity 0.5s ease;
    opacity: 0;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-small {
    padding: 12px 20px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.forgot-password-container {
    text-align: center;
    margin-top: 20px;
}

.forgot-password-container a {
    color: var(--accent-color);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password-container a:hover {
    color: white;
    text-decoration: underline;
}

.forgot-form-container {
    margin-top: 25px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
}

.forgot-form-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.forgot-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.or-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #8d8f9a;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.or-divider span {
    padding: 0 15px;
    font-size: 14px;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.social-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.signup-link {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #8d8f9a;
}

.signup-link a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-10px);
}

.message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.message.error {
    background: rgba(255, 61, 65, 0.2);
    border-left: 3px solid var(--error-color);
}

.message.success {
    background: rgba(0, 200, 81, 0.2);
    border-left: 3px solid var(--success-color);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}

.checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: var(--input-background);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 14px;
    color: #c2c5d1;
    user-select: none;
}

/* Password strength meter */
.password-strength {
    margin-top: 8px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.strength-meter {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-text {
    font-size: 12px;
    margin-top: 5px;
    text-align: right;
}

.weak {
    background: #ff3d41;
    width: 25%;
}

.medium {
    background: #ffc107;
    width: 50%;
}

.strong {
    background: #00c851;
    width: 100%;
}

/* Loader animation */
.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -12px;
    margin-left: -12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.loading {
    color: transparent;
}

.btn.loading .loader {
    display: block;
}

/* Particles animation */
@keyframes floatParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100vh) translateX(30vw);
        opacity: 0;
    }
}

/* Responsive styles */
@media (max-width: 480px) {
    .container {
        padding: 20px;
        width: 90%;
    }
    
    .social-btn {
        width: 50px;
        height: 50px;
    }
    
    .forgot-actions {
        flex-direction: column;
    }
    
    .btn-secondary, .btn-small {
        width: 100%;
    }
}

/* Success message styling */
.message.success {
    background: rgba(0, 200, 81, 0.2);
    border-left: 3px solid var(--success-color);
}

/* Success animation for container */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 200, 81, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 200, 81, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 200, 81, 0);
    }
}

.success-animation {
    animation: successPulse 1.5s ease-out;
    border-color: var(--success-color);
}

/* Fade-out effect before redirect */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}