/* ============================================
   Modern Login Page Styles with Gradients
   ============================================ */

/* Login Container with Animated Gradient Background */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(360deg); }
}

/* Login Wrapper - Glass Morphism Effect */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 1;
}

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

/* Logo Section with Gradient Background */
.logo-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>');
    opacity: 0.3;
}

.logo-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.logo-img {
    max-width: 100px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

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

.welcome-text {
    position: relative;
    z-index: 1;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.form-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Form Section */
.form-section {
    padding: 40px 35px;
    background: #ffffff;
}

.form-container {
    width: 100%;
}

/* Input Group Wrapper */
.input-group-wrapper {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* Input with Icon Container */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #667eea;
    font-size: 16px;
    z-index: 2;
    transition: color 0.3s ease;
}

/* Modern Input Styling */
.modern-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #2d3748;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modern-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
    background: #ffffff;
}

.modern-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.modern-input.is-invalid {
    border-color: #fc8181;
    box-shadow: 0 0 0 4px rgba(252, 129, 129, 0.1);
}

.modern-input.is-invalid:focus {
    border-color: #fc8181;
    box-shadow: 0 0 0 4px rgba(252, 129, 129, 0.15);
}

.modern-input:focus + .input-icon,
.modern-input:focus ~ .input-icon {
    color: #667eea;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    cursor: pointer;
    color: #a0aec0;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 2;
    padding: 5px;
}

.password-toggle:hover {
    color: #667eea;
}

/* Remember Me Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.remember-label {
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}

/* Forgot Password Link */
.forgot-password-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Gradient Sign In Button */
.btn-gradient-signin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-gradient-signin::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 ease;
}

.btn-gradient-signin:hover::before {
    left: 100%;
}

.btn-gradient-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: #ffffff;
}

.btn-gradient-signin:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.btn-gradient-signin:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3), 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-gradient-signin.loading {
    pointer-events: none;
}

.btn-gradient-signin.loading .indicator-label {
    display: none;
}

.btn-gradient-signin.loading .indicator-progress {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Form Headings */
.form-heading {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-description {
    font-size: 14px;
    color: #718096;
    margin-bottom: 0;
}

/* Back Link */
.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.back-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* CAPTCHA Styles */
.captcha-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-image-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.captcha-image-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 180px;
    height: 50px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.captcha-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.captcha-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.captcha-input-field {
    flex: 1;
}

.captcha-input {
    padding: 14px 16px;
    height: 50px;
}

.btn-refresh-captcha-circle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-refresh-captcha-circle:hover {
    transform: translateY(-2px) rotate(180deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-refresh-captcha-circle:active {
    transform: translateY(0) rotate(180deg);
}

.btn-refresh-captcha-circle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-refresh-captcha-circle:hover i {
    transform: rotate(180deg);
}

/* Responsive CAPTCHA */
@media (max-width: 480px) {
    .captcha-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-image-container {
        justify-content: center;
        width: 100%;
    }
    
    .captcha-image-wrapper {
        width: 100%;
        max-width: 250px;
    }
    
    .captcha-input-field {
        width: 100%;
    }
}

/* Error Messages */
.error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #e53e3e;
    font-weight: 500;
    margin-top: 6px;
    animation: shake 0.4s ease;
}

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

.error-message i {
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }
    
    .login-wrapper {
        max-width: 100%;
        border-radius: 20px;
    }
    
    .logo-section {
        padding: 30px 20px 20px;
    }
    
    .logo-img {
        max-width: 80px;
    }
    
    .form-section {
        padding: 30px 25px;
    }
    
    .form-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }
    
    .logo-section {
        padding: 25px 15px 15px;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .form-title {
        font-size: 22px;
    }
    
    .modern-input {
        padding: 12px 14px 12px 44px;
        font-size: 14px;
    }
    
    .btn-gradient-signin {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    animation: spin 0.75s linear infinite;
}

/* Additional Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Focus visible for accessibility */
.modern-input:focus-visible,
.btn-gradient-signin:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
