﻿:root {
    --primary-color: #4e73df;
    --primary-hover: #375ac9;
    --secondary-color: #e0e0f5;
    --text-color: #333;
    --text-muted: #6c757d;
    --background-color: #f8f9fc;
    --card-bg: #ffffff;
    --input-bg: transparent;
    --input-border: #e1e1e1;
    --input-border-focus: rgba(78, 115, 223, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --success-color: #1cc88a;
    --error-color: #e74a3b;
    --transition-time: 0.3s;
    --border-radius: 10px;
    --icon-primary: rgba(78, 115, 223, 0.5);
    --icon-secondary: rgba(78, 115, 223, 0.3);
    --icon-tertiary: rgba(78, 115, 223, 0.2);
}

/* Dark Theme Variables */
.dark-theme {
    --primary-color: #5a78e6;
    --primary-hover: #7289e8;
    --secondary-color: #2c3e50;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --background-color: #131b30;
    --card-bg: #1e293b;
    --input-bg: transparent;
    --input-border: #344256;
    --input-border-focus: rgba(90, 120, 230, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --icon-primary: rgba(90, 120, 230, 0.5);
    --icon-secondary: rgba(90, 120, 230, 0.3);
    --icon-tertiary: rgba(90, 120, 230, 0.2);
}



/* Dark mode input field styles */
body.dark-theme .form-control {
  
    color: var(--text-color); /* Ensure text is visible */
    border-color: var(--input-border); /* Set a visible border color */
}

/* Input field on focus in dark mode */
body.dark-theme .form-control:focus {
  
    color: var(--text-color); /* Ensure text remains visible */
    border-color: var(--primary-color); /* Highlight border on focus */
    box-shadow: 0 0 0 4px var(--input-border-focus); /* Add a focus outline */
}

/* Placeholder text in dark mode */
body.dark-theme .form-control::placeholder {
    color: var(--text-muted); /* Ensure placeholder text is visible */
}
   

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color var(--transition-time), color var(--transition-time), border-color var(--transition-time);
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    color: var(--icon-primary);
    opacity: 0.4;
    z-index: -1;
    animation: float 15s linear infinite;
    filter: drop-shadow(0 0 10px var(--icon-tertiary));
}

.floating-item i {
    font-size: 2.5rem;
}

/* Different colors for variety */
.floating-item:nth-child(3n+1) {
    color: var(--icon-primary);
}

.floating-item:nth-child(3n+2) {
    color: var(--icon-secondary);
}

.floating-item:nth-child(3n+3) {
    color: var(--icon-tertiary);
}

/* Different sizes for variety */
.floating-item:nth-child(4n+1) i {
    font-size: 2.8rem;
}

.floating-item:nth-child(4n+2) i {
    font-size: 2.5rem;
}

.floating-item:nth-child(4n+3) i {
    font-size: 3.2rem;
}

.floating-item:nth-child(4n+4) i {
    font-size: 2.2rem;
}

/* Specific positioning is now handled by JavaScript for random distribution */

.code-icon, .terminal-icon, .microchip-icon {
    animation-duration: 20s;
}

.database-icon, .server-icon, .hdd-icon {
    animation-duration: 25s;
}

.cloud-icon, .wifi-icon, .network-icon {
    animation-duration: 18s;
}

.cog-icon, .wrench-icon, .screwdriver-icon, .tools-icon {
    animation-duration: 22s;
}

.bug-icon, .desktop-icon, .mobile-icon, .keyboard-icon, .bluetooth-icon {
    animation-duration: 30s;
}

.techsoft-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation-duration: 35s;
    opacity: 0.6;
}

.techsoft-logo i {
    font-size: 3.5rem;
    margin-bottom: 5px;
}

.techsoft-logo span {
    font-weight: bold;
    font-size: 2rem;
}

/* Custom logo styles */
.custom-logo {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 120px;
    height: 120px;
    opacity: 0.8;
    animation-duration: 25s;
    animation-name: logoFloat;
    filter: drop-shadow(0 0 15px var(--icon-primary));
    z-index: 0;
}

/* Special animation just for the logo */
@keyframes logoFloat {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    20% {
        transform: translate(200px, -150px) rotate(10deg) scale(1.2);
        opacity: 0.9;
    }
    40% {
        transform: translate(-200px, -100px) rotate(5deg) scale(1.1);
        opacity: 0.8;
    }
    60% {
        transform: translate(-180px, 150px) rotate(-5deg) scale(1.15);
        opacity: 0.9;
    }
    80% {
        transform: translate(220px, 120px) rotate(-10deg) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.8;
    }
}

/* Fix for the flip animation */
.forms-container {
    position: relative;
    width: 100%;
    max-width: 430px;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.login-container {
    background-color: var(--card-bg);
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 30px var(--shadow-color);
    padding: 35px 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: center center;
}

/* Specifically define opacity transition separately for better control */
#login-form, .forgot-password-container {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease-in-out,
                z-index 0.1s;
}

#login-form {
    transform: rotateY(0deg);
    z-index: 2;
    position: relative;
}

.forgot-password-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: rotateY(180deg);
    z-index: 1;
    opacity: 0;
}

.forgot-password-container.active {
    transform: rotateY(0);
    z-index: 5;
    opacity: 1;
}

#login-form.inactive {
    transform: rotateY(-180deg);
    z-index: 1;
    opacity: 0;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo i {
    font-size: 3rem;
    color: var(--primary-color);
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.2);
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    color: var(--text-muted);
    font-size: 16px;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.3s ease;
    z-index: 10;
}

.theme-label {
    font-size: 14px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(10deg);
}

.theme-toggle:hover .theme-label {
    opacity: 1;
    transform: translateX(0);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group {
    position: relative;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 16px 15px 16px 45px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 16px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-border-focus);
    outline: none;
    background-color: var(--input-bg); /* Keep background transparent on focus */
}

.form-control::placeholder {
    color: transparent;
}

.input-group label {
    position: absolute;
    left: 45px;
    top: 16px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.3s ease, 
                font-size 0.3s ease, 
                color 0.3s ease, 
                background-color 0.3s ease,
                box-shadow 0.3s ease;
    padding: 0 5px;
    transform-origin: left top;
    z-index: 1;
}

.form-control:focus ~ label, 
.form-control:not(:placeholder-shown) ~ label {
    transform: translateY(-28px) scale(0.85);
    color: var(--primary-color);
    font-weight: 500;
    z-index: 2;
}

/* Enhanced fix for label background to blend with input border */
.form-control:focus ~ label,
.form-control:not(:placeholder-shown) ~ label {
    background-color: var(--card-bg);
    margin-left: -5px;
    padding: 0 5px;
    /* This creates a small space that covers the border */
    box-shadow: 0 0 0 2px var(--card-bg);
    /* Raise it slightly higher to ensure it clears the border */
    transform: translateY(-40px) translateX(-15px) scale(0.85);
    /* Adjust the translateX value to match the input padding */
    border-radius: 4px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.form-control:focus ~ .input-icon {
    color: var(--primary-color);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.forgot-password, .back-to-login {
    text-align: right;
    margin-bottom: 25px;
}

.forgot-password a, .back-to-login a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 5px;
    display: inline-block;
    position: relative;
}

.forgot-password a::after, .back-to-login a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 2px;
    left: 5px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.forgot-password a:hover, .back-to-login a:hover {
    color: var(--primary-color);
}

.forgot-password a:hover::after, .back-to-login a:hover::after {
    width: calc(100% - 10px);
}

.login-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.2);
}

.login-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(78, 115, 223, 0.3);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(3px);
}

.login-feedback {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 14px;
    display: none;
    transition: all 0.3s ease;
}

.login-feedback.error {
    background-color: rgba(231, 74, 59, 0.1);
    color: var(--error-color);
    display: block;
}

.login-feedback.success {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
    display: block;
}

/* Animations */
@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 cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .form-control {
        padding: 14px 12px 14px 40px;
    }
    
    .input-group label {
        left: 40px;
    }
    
    .logo i {
        font-size: 2.5rem;
        padding: 12px;
    }
}

.container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.8s ease-in-out;
    z-index: 1;
}

/* Remove hover effect */
.login-container:hover {
    transform: translateY(0);
    box-shadow: 0 15px 30px var(--shadow-color);
}

