:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --light-bg: #f8f9fa;
    --text-color: #333;
    --text-light: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --border-color: #dee2e6;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body.loading::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.loading::after {
    content: 'Loading...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    font-size: 1.2rem;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Top navigation (Back to Home button) */
.top-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.back-home {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.back-home:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.back-home i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Form container styles */
.form-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transition: var(--transition);
    margin: 60px 0 20px;
}

.form-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    text-align: center;
}

.form-header h2 {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.8rem;
    color: white;
    border-bottom: none;
    padding: 0;
    margin: 0 0 8px 0;
}

.form-header p {
    opacity: 0.9;
    font-size: 1rem;
    margin: 0;
}

.form-content {
    padding: 25px;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.form-group label i {
    margin-right: 10px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 40px;
    color: var(--text-light);
}

small {
    display: block;
    color: var(--text-light);
    margin-top: 5px;
    font-size: 0.85rem;
}

/* Error and success messages */
.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--error-color);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    color: var(--error-color);
    display: flex;
    align-items: center;
}

.error i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.error-list {
    margin: 10px 0;
    padding-left: 20px;
}

.error-list li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.error-list li:before {
    content: "•";
    color: var(--error-color);
    font-weight: bold;
    margin-right: 10px;
}

.success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    color: var(--success-color);
    display: flex;
    align-items: center;
}

.success i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Buttons */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

button i {
    margin-right: 10px;
}

button:hover {
    background: linear-gradient(to right, var(--primary-dark), #5e18a7);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Links */
.register-link, .login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.register-link a, .login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.register-link a:hover, .login-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.register-link a i, .login-link a i {
    margin-right: 8px;
}

.forgot-password {
    text-align: right;
    margin: -10px 0 20px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.forgot-password a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.forgot-password a i {
    margin-right: 5px;
}

.back-to-login {
    text-align: center;
    margin-bottom: 20px;
}

.back-to-login a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.back-to-login a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.back-to-login a i {
    margin-right: 5px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 40px;
    cursor: pointer;
    color: var(--text-light);
}

/* Responsive styles */
@media (max-width: 576px) {
    .form-container {
        border-radius: 10px;
        margin-top: 50px;
    }
    
    .top-nav {
        left: 50%;
        transform: translateX(-50%);
        top: 10px;
        width: 90%;
        text-align: center;
    }
    
    .back-home {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .form-header {
        padding: 20px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-content {
        padding: 20px;
    }
    
    .form-group input {
        padding: 12px 12px 12px 40px;
    }
    
    .input-icon {
        left: 12px;
        top: 38px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 15px 10px;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .form-header p {
        font-size: 0.9rem;
    }
    
    .back-home {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for form */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeIn 0.5s ease;
}

.back-home {
    animation: fadeIn 0.7s ease;
}

@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;
}