/* Mobile-friendly Login Page Styles */

/* General mobile optimizations */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    /* Remove default container margin on mobile */
    .container.mt-4 {
        margin-top: 0 !important;
        padding: 20px 15px;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Login card mobile optimizations */
@media (max-width: 768px) {
    .login-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        border: none;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .login-card .card-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 15px 15px 0 0 !important;
        padding: 25px 20px;
        border: none;
    }
    
    .login-card .card-header h4 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
    }
    
    .login-card .card-body {
        padding: 30px 25px;
    }
    
    /* Form elements mobile optimization */
    .form-label {
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        font-size: 0.95rem;
    }
    
    .form-control {
        border-radius: 10px;
        border: 2px solid #e1e5e9;
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        transition: all 0.3s ease;
        background: #f8f9fa;
    }
    
    .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        background: white;
    }
    
    /* Input group mobile optimization */
    .input-group {
        border-radius: 10px;
        overflow: hidden;
        display: flex;
        align-items: stretch;
    }
    
    .input-group .form-control {
        border-radius: 10px 0 0 10px;
        border-right: none;
        flex: 1;
        min-height: 44px;
    }
    
    .input-group .btn {
        border-radius: 0 10px 10px 0;
        border: 2px solid #e1e5e9;
        border-left: none;
        background: #f8f9fa;
        color: #6c757d;
        padding: 12px 15px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .input-group .btn:hover {
        background: #e9ecef;
        color: #495057;
    }
    
    /* Password toggle specific styling */
    .password-toggle-btn {
        border: 2px solid #e1e5e9 !important;
        border-left: none !important;
        background: #f8f9fa !important;
        color: #6c757d !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    .password-toggle-btn:hover {
        background: #e9ecef !important;
        color: #495057 !important;
    }
    
    .password-toggle-btn i {
        font-size: 18px !important;
    }
    
    /* Login button mobile optimization */
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 10px;
        padding: 15px 20px;
        font-size: 1.1rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    .btn-primary:active {
        transform: translateY(0);
    }
    
    /* Forgot password link */
    .forgot-password-link {
        color: #667eea;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }
    
    .forgot-password-link:hover {
        color: #764ba2;
        text-decoration: underline;
    }
    
    /* Divider */
    .login-divider {
        margin: 25px 0;
        border: none;
        height: 1px;
        background: linear-gradient(90deg, transparent, #e1e5e9, transparent);
    }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    .container.mt-4 {
        padding: 15px 10px;
    }
    
    .login-card .card-body {
        padding: 25px 20px;
    }
    
    .login-card .card-header {
        padding: 20px 15px;
    }
    
    .login-card .card-header h4 {
        font-size: 1.3rem;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .btn-primary {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container.mt-4 {
        padding: 10px 15px;
    }
    
    .login-card {
        max-width: 350px;
    }
    
    .login-card .card-body {
        padding: 20px 20px;
    }
}

/* Loading state for button */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message styling */
.alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 20px;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

/* Success message styling */
.alert-info {
    background: linear-gradient(135deg, #74c0fc 0%, #4dabf7 100%);
    color: white;
}
